Browse code

Add acceptance test for bracketed paste characters

John Hawthorn authored on 13/08/2017 14:27:39
Showing 1 changed files

... ...
@@ -288,6 +288,16 @@ class FzyTest < Minitest::Test
288 288
     @tty.assert_matches "before\nfoo\nafter"
289 289
   end
290 290
 
291
+  # More info;
292
+  # https://github.com/jhawthorn/fzy/issues/42
293
+  # https://cirw.in/blog/bracketed-paste
294
+  def test_bracketed_paste_characters
295
+    @tty = TTYtest.new_terminal(%{echo -n "foo\nbar" | #{FZY_PATH}})
296
+    @tty.assert_matches ">\nfoo\nbar"
297
+    @tty.send_keys("\e[200~foo\e[201~")
298
+    @tty.assert_matches "> foo\nfoo"
299
+  end
300
+
291 301
   def test_help
292 302
     @tty = TTYtest.new_terminal(%{#{FZY_PATH} --help})
293 303
     @tty.assert_matches <<TTY