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

adding tests for custom-patterns

This commit is contained in:
Jorge Morante 2016-10-22 11:06:59 +02:00
parent 208b63acc7
commit 14e067cb41
4 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,6 @@
set -g prefix C-a
set -g @fingers-compact-hints '0'
set -g @fingers-pattern-0 'YOLOYOLOYOLO'
set -g @fingers-pattern-50 'W00TW00TW00T'
run /home/vagrant/shared/tmux-fingers.tmux

5
test/fixtures/custom-patterns vendored Normal file
View File

@ -0,0 +1,5 @@
YOLOYOLOYOLO
beep
W00TW00TW00T
beep

View File

@ -42,6 +42,11 @@ proc echo_yanked {} {
sleep 0.5;
}
proc tmux_paste {} {
tmux_send "]";
sleep 0.5;
}
proc exit_ok {} {
global exit_code
set exit_code 0;

View File

@ -0,0 +1,32 @@
#!/usr/bin/env expect
set timeout 1;
set tmux_prefix "";
source "./test/helpers.exp"
exec "tmux kill-session -t test";
spawn tmux -f ./test/conf/custom-patterns.conf new -s test;
sleep 0.5;
init_pane
exec "cat ./test/fixtures/custom-patterns";
send "echo yanked text is "
invoke_fingers;
send "i";
tmux_paste;
invoke_fingers;
send "o";
tmux_paste;
send "\r";
sleep 0.5;
expect {
"yanked text is W00TW00TW00TYOLOYOLOYOLO" { exit_ok }
timeout { exit_fail }
}
exit $exit_code;