fzy
terminal fuzzy finder picker
git clone https://9o.is/git/fzy.git
commit 2bf8110e152af17cc59d84152da66c3dad05f185 parent 656744dc0aaf00c99aed4b5873df8a161cc0b8db Author: John Hawthorn <john.hawthorn@gmail.com> Date: Wed, 28 Dec 2016 01:38:20 -0800 Add integration test for ctrl-d and ctrl-d Diffstat:
| M | test/integration/integration_test.rb | | | 28 | ++++++++++++++++++++++++++++ |
1 file changed, 28 insertions(+), 0 deletions(-)
diff --git a/test/integration/integration_test.rb b/test/integration/integration_test.rb @@ -123,4 +123,32 @@ class FzyTest < Minitest::Test @tty.assert_row(1, '>') @tty.assert_cursor_position(y: 1, x: 2) end + + def test_ctrl_d + @tty = TTYtest.driver.new_terminal(%{echo -n "foo\nbar" | fzy}) + @tty.assert_row(0, '>') + + @tty.send_keys('foo') + @tty.assert_row(0, '> foo') + + @tty.send_keys(ctrl('D')) + @tty.assert_row(0, '') + @tty.assert_row(1, '') + @tty.assert_row(2, '') + @tty.assert_cursor_position(y: 0, x: 0) + end + + def test_ctrl_c + @tty = TTYtest.driver.new_terminal(%{echo -n "foo\nbar" | fzy}) + @tty.assert_row(0, '>') + + @tty.send_keys('foo') + @tty.assert_row(0, '> foo') + + @tty.send_keys(ctrl('C')) + @tty.assert_row(0, '') + @tty.assert_row(1, '') + @tty.assert_row(2, '') + @tty.assert_cursor_position(y: 0, x: 0) + end end