1
0
mirror of https://github.com/Morantron/tmux-fingers.git synced 2024-06-26 07:29:11 +02:00
tmux-fingers/test/helpers.exp

68 lines
934 B
Plaintext
Raw Normal View History

2016-07-14 22:48:01 +02:00
#!/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";
}
2017-02-14 08:29:42 +01:00
proc init_pane_fish {} {
tmux_send "c";
exec "function fish_prompt; echo '# '; end"
exec "clear"
}
2016-07-14 22:48:01 +02:00
proc invoke_fingers {} {
tmux_send "F";
sleep 1.0;
2016-07-14 22:48:01 +02:00
}
proc echo_yanked {} {
exec "clear";
send "echo yanked text is ";
tmux_send "]";
send "\r";
sleep 0.5;
2016-07-14 22:48:01 +02:00
}
2016-10-22 11:06:59 +02:00
proc tmux_paste {} {
tmux_send "]";
sleep 0.5;
}
2016-07-14 22:48:01 +02:00
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;
}