diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-25 10:27:06 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-25 10:43:02 -0400 |
| commit | 7837a88380da6057b81d1f741d39a79bc83993c0 (patch) | |
| tree | e954d6057c8c5866a0e401b88b152067c4c5880e /tests | |
| parent | Add ability to use prefix key with key bindings (diff) | |
| download | tmux-toggle-term-0.4.0.zip | |
Add ability to disable float or split functionalityv0.4.0
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tests.sh | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/tests/tests.sh b/tests/tests.sh index bf9204e..88e34aa 100644 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -185,3 +185,96 @@ load_plugin() { run tmux_has_prefix_binding "C-;" "split" assert_failure } + +@test 'both float and split are enabled by default' { + run load_plugin + assert_success + + run tmux_has_root_binding "C-f" "float" + assert_success + run tmux_has_root_binding "C-;" "split" + assert_success +} + +@test 'float can be disabled' { + tmux_set_option "@toggle-term-float-enabled" "false" + + run load_plugin + assert_success + + run tmux_has_root_binding "C-f" "float" + assert_failure + run tmux_has_root_binding "C-;" "split" + assert_success +} + +@test 'split can be disabled' { + tmux_set_option "@toggle-term-split-enabled" "false" + + run load_plugin + assert_success + + run tmux_has_root_binding "C-f" "float" + assert_success + run tmux_has_root_binding "C-;" "split" + assert_failure +} + +@test 'both float and split can be disabled' { + tmux_set_option "@toggle-term-float-enabled" "false" + tmux_set_option "@toggle-term-split-enabled" "false" + + run load_plugin + assert_success + + run tmux_has_root_binding "C-f" "float" + assert_failure + run tmux_has_root_binding "C-;" "split" + assert_failure +} + +@test 'disabled float does not bind with custom key' { + tmux_set_option "@toggle-term-float-enabled" "false" + tmux_set_option "@toggle-term-float-key" "M-f" + + run load_plugin + assert_success + + run tmux_has_root_binding "M-f" "float" + assert_failure +} + +@test 'disabled split does not bind with custom key' { + tmux_set_option "@toggle-term-split-enabled" "false" + tmux_set_option "@toggle-term-split-key" "M-t" + + run load_plugin + assert_success + + run tmux_has_root_binding "M-t" "split" + assert_failure +} + +@test 'disabled float does not bind with prefix' { + tmux_set_option "@toggle-term-float-enabled" "false" + tmux_set_option "@toggle-term-float-key" "f" + tmux_set_option "@toggle-term-float-use-prefix" "true" + + run load_plugin + assert_success + + run tmux_has_prefix_binding "f" "float" + assert_failure +} + +@test 'disabled split does not bind with prefix' { + tmux_set_option "@toggle-term-split-enabled" "false" + tmux_set_option "@toggle-term-split-key" "f" + tmux_set_option "@toggle-term-split-use-prefix" "true" + + run load_plugin + assert_success + + run tmux_has_prefix_binding "f" "split" + assert_failure +} |