summaryrefslogtreecommitdiff
path: root/test/reline
diff options
context:
space:
mode:
authortomoya ishida <[email protected]>2024-06-05 03:34:57 +0900
committergit <[email protected]>2024-06-04 18:35:03 +0000
commit932ecd3a1c8a2c5094406063903866499176529e (patch)
tree78223ab78df61fb33d412a40b3ded7899917aa83 /test/reline
parent5ea843f9b237c08dbdc82125462cf431bd885c7b (diff)
[ruby/reline] Ensure no escape sequence before printing prompt
(https://github.com/ruby/reline/pull/716) https://github.com/ruby/reline/commit/f9227b5c89
Diffstat (limited to 'test/reline')
-rw-r--r--test/reline/test_reline.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/reline/test_reline.rb b/test/reline/test_reline.rb
index deff411232..601e484048 100644
--- a/test/reline/test_reline.rb
+++ b/test/reline/test_reline.rb
@@ -378,6 +378,18 @@ class Reline::Test < Reline::TestCase
assert_match(/#<Reline::Dumb/, out.chomp)
end
+ def test_print_prompt_before_everything_else
+ pend if win?
+ lib = File.expand_path("../../lib", __dir__)
+ code = "p Reline::IOGate.class; p Reline.readline 'prompt> '"
+ out = IO.popen([Reline.test_rubybin, "-I#{lib}", "-rreline", "-e", code], "r+") do |io|
+ io.write "abc\n"
+ io.close_write
+ io.read
+ end
+ assert_match(/\AReline::ANSI\nprompt> /, out)
+ end
+
def test_require_reline_should_not_trigger_winsize
pend if win?
lib = File.expand_path("../../lib", __dir__)