From 757b31309434d7adcd1361be26c1cd2a44d6ec9b Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Sun, 9 Sep 2018 13:05:12 -0700 Subject: Disable line wrap when printing candidates This solves the line wrapping issue with much simpler code, which also works better with Unicode characters and when the terminal is resized. --- test/acceptance/acceptance_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/acceptance/acceptance_test.rb') diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb index 6123b2d..6ab8b34 100644 --- a/test/acceptance/acceptance_test.rb +++ b/test/acceptance/acceptance_test.rb @@ -430,6 +430,18 @@ class FzyTest < Minitest::Test @tty.assert_cursor_position(y: 0, x: 8) end + def test_long_strings + ascii = "LongStringOfText" * 6 + unicode = "LongStringOfText" * 3 + + @tty = interactive_fzy(input: [ascii, unicode]) + @tty.assert_matches <<~TTY + > + LongStringOfTextLongStringOfTextLongStringOfTextLongStringOfTextLongStringOfText + LongStringOfTextLongStringOfTextLongStri + TTY + end + def test_help @tty = TTYtest.new_terminal(%{#{FZY_PATH} --help}) @tty.assert_matches <