mirror of
https://github.com/Morantron/tmux-fingers.git
synced 2024-07-01 08:10:57 +02:00
adding tests for custom-patterns
This commit is contained in:
parent
208b63acc7
commit
14e067cb41
6
test/conf/custom-patterns.conf
Normal file
6
test/conf/custom-patterns.conf
Normal 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
5
test/fixtures/custom-patterns
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
YOLOYOLOYOLO
|
||||||
|
beep
|
||||||
|
|
||||||
|
W00TW00TW00T
|
||||||
|
beep
|
|
@ -42,6 +42,11 @@ proc echo_yanked {} {
|
||||||
sleep 0.5;
|
sleep 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc tmux_paste {} {
|
||||||
|
tmux_send "]";
|
||||||
|
sleep 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
proc exit_ok {} {
|
proc exit_ok {} {
|
||||||
global exit_code
|
global exit_code
|
||||||
set exit_code 0;
|
set exit_code 0;
|
||||||
|
|
32
test/specs/matches-custom-patterns_spec.exp
Executable file
32
test/specs/matches-custom-patterns_spec.exp
Executable 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;
|
Loading…
Reference in New Issue
Block a user