tmux-fingers/test/helpers.exp

56 lines
761 B
Plaintext

#!/usr/bin/env expect
set exit_code 2
proc test_clean_up {} {
exec "tmux kill-session -t test";
sleep 0.5;
}
proc exec {cmd} {
sleep 0.5;
send "$cmd";
sleep 0.5;
send "\r";
sleep 0.5;
}
proc tmux_send {key} {
global tmux_prefix;
sleep 0.5;
send $tmux_prefix;
sleep 0.5;
send "$key";
sleep 0.5;
}
proc init_pane {} {
tmux_send "c";
exec "export PS1='# '; clear";
}
proc invoke_fingers {} {
tmux_send "F";
sleep 0.5;
}
proc echo_yanked {} {
exec "clear";
send "echo yanked text is ";
tmux_send "]";
send "\r";
}
proc exit_ok {} {
global exit_code
set exit_code 0;
test_clean_up;
}
proc exit_fail {} {
global exit_code
set exit_code 1;
exec "tmux list-buffers >> ./spec-output.log"
test_clean_up;
}