diff --git a/tests/bind_mode_events.expect b/tests/bind_mode_events.expect deleted file mode 100644 index bec435d0c..000000000 --- a/tests/bind_mode_events.expect +++ /dev/null @@ -1,36 +0,0 @@ -# vim: set filetype=expect: -spawn $fish -expect_prompt - -send "set -g fish_key_bindings fish_vi_key_bindings\r" -expect_prompt - -send "echo ready to go\r" -expect_prompt -re {\r\nready to go\r\n} { - puts "ready to go" -} -send "function add_change --on-variable fish_bind_mode ; set -g MODE_CHANGES \$MODE_CHANGES \$fish_bind_mode ; end\r" -expect_prompt - -# normal mode -send "\033" -sleep 0.050 - -# insert mode -send "i" -sleep 0.050 - -# back to normal mode -send "\033" -sleep 0.050 - -# insert mode again -send "i" -sleep 0.050 - -send "echo mode changes: \$MODE_CHANGES\r" -expect_prompt -re {\r\nmode changes: default insert default insert\r\n} { - puts "Correct mode changes" -} unmatched { - puts "Incorrect mode changes" -} diff --git a/tests/bind_mode_events.expect.err b/tests/bind_mode_events.expect.err deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/bind_mode_events.expect.out b/tests/bind_mode_events.expect.out deleted file mode 100644 index 487091460..000000000 --- a/tests/bind_mode_events.expect.out +++ /dev/null @@ -1,2 +0,0 @@ -ready to go -Correct mode changes diff --git a/tests/pexpects/bind_mode_events.py b/tests/pexpects/bind_mode_events.py new file mode 100644 index 000000000..d0f262346 --- /dev/null +++ b/tests/pexpects/bind_mode_events.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +from pexpect_helper import SpawnedProc + +sp = SpawnedProc() +send, sendline, sleep, expect_prompt = sp.send, sp.sendline, sp.sleep, sp.expect_prompt +expect_prompt() + +send("set -g fish_key_bindings fish_vi_key_bindings\r") +expect_prompt() + +send("echo ready to go\r") +expect_prompt("\r\nready to go\r\n") +send("function add_change --on-variable fish_bind_mode ; set -g MODE_CHANGES $MODE_CHANGES $fish_bind_mode ; end\r") +expect_prompt() + +# normal mode +send("\033") +sleep(0.050) + +# insert mode +send("i") +sleep(0.050) + +# back to normal mode +send("\033") +sleep(0.050) + +# insert mode again +send("i") +sleep(0.050) + +send("echo mode changes: $MODE_CHANGES\r") +expect_prompt("\r\nmode changes: default insert default insert\r\n")