diff --git a/test/conf/custom-patterns.conf b/test/conf/custom-patterns.conf new file mode 100644 index 0000000..418e27e --- /dev/null +++ b/test/conf/custom-patterns.conf @@ -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 diff --git a/test/fixtures/custom-patterns b/test/fixtures/custom-patterns new file mode 100644 index 0000000..ee6c961 --- /dev/null +++ b/test/fixtures/custom-patterns @@ -0,0 +1,5 @@ +YOLOYOLOYOLO +beep + +W00TW00TW00T +beep diff --git a/test/helpers.exp b/test/helpers.exp index b2ade99..ac496f1 100644 --- a/test/helpers.exp +++ b/test/helpers.exp @@ -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; diff --git a/test/specs/matches-custom-patterns_spec.exp b/test/specs/matches-custom-patterns_spec.exp new file mode 100755 index 0000000..3c03d7e --- /dev/null +++ b/test/specs/matches-custom-patterns_spec.exp @@ -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;