Skip to content

Commit

Permalink
Skip tests depend on Readline's special behaviors
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed May 12, 2019
1 parent caef2dd commit 75f196c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test/readline/test_readline.rb
Expand Up @@ -113,7 +113,7 @@ def test_line_buffer__point
assert_equal(true, Readline.line_buffer.tainted?)
assert_equal(21, Readline.point)
end
end
end if Readline != Reline
end

def test_input=
Expand Down Expand Up @@ -376,12 +376,14 @@ def test_delete_text
assert_equal(str, Readline.line_buffer)
Readline.delete_text

# NOTE: unexpected but GNU Readline's spec
assert_equal(16, Readline.point)
assert_equal("", Readline.line_buffer)
assert_equal(Readline, Readline.insert_text(str))
assert_equal(32, Readline.point)
assert_equal("", Readline.line_buffer)
unless Readline == Reline
# NOTE: unexpected but GNU Readline's spec
assert_equal(16, Readline.point)
assert_equal("", Readline.line_buffer)
assert_equal(Readline, Readline.insert_text(str))
assert_equal(32, Readline.point)
assert_equal("", Readline.line_buffer)
end
rescue NotImplementedError
end if !/EditLine/n.match(Readline::VERSION)

Expand All @@ -399,7 +401,9 @@ def test_modify_text_in_pre_input_hook
line = Readline.readline("> ")
assert_equal("hello world", line)
end
assert_equal("> hello world\n", stdout.read)
unless Readline == Reline # Reline's rendering logic is tricky
assert_equal("> hello world\n", stdout.read)
end
stdout.close
rescue NotImplementedError
ensure
Expand Down

0 comments on commit 75f196c

Please sign in to comment.