summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2018-09-09 13:31:40 -0700
committerJohn Hawthorn <john@hawthorn.email>2018-09-09 13:32:10 -0700
commitb11cf881afb47e54d8168e62bf958525b971b6d0 (patch)
tree8610d731469cacd1bb5751f1096a6207c707b95d
parent757b31309434d7adcd1361be26c1cd2a44d6ec9b (diff)
Fix acceptance tests
-rw-r--r--test/acceptance/acceptance_test.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/acceptance/acceptance_test.rb b/test/acceptance/acceptance_test.rb
index 6ab8b34..52c6af0 100644
--- a/test/acceptance/acceptance_test.rb
+++ b/test/acceptance/acceptance_test.rb
@@ -328,7 +328,11 @@ class FzyTest < Minitest::Test
# https://github.com/jhawthorn/fzy/issues/81
def test_slow_stdin_fast_user
- @tty = TTYtest.new_terminal(%{(echo aa; echo bc; echo bd; sleep 0.5) | #{FZY_PATH}})
+ @tty = TTYtest.new_terminal(%{(sleep 0.5; echo aa; echo bc; echo bd) | #{FZY_PATH}})
+
+ # Before input has all come in, but wait for fzy to at least start
+ sleep 0.1
+
@tty.send_keys("b\r")
@tty.assert_matches "bc"
end
@@ -463,7 +467,7 @@ TTY
def interactive_fzy(input: [], before: nil, after: nil, args: "")
cmd = []
cmd << %{echo "#{before}"} if before
- cmd << %{echo -n "#{input.join("\\n")}" | #{FZY_PATH} #{args}}
+ cmd << %{printf "#{input.join("\\n")}" | #{FZY_PATH} #{args}}
cmd << %{echo "#{after}"} if after
cmd = cmd.join("; ")
TTYtest.new_terminal(cmd)