diff options
author | Stan Lo <[email protected]> | 2022-12-27 16:43:40 +0000 |
---|---|---|
committer | git <[email protected]> | 2022-12-27 16:43:44 +0000 |
commit | 140c93e2dcdccc640a3be3ad6b5f7a7696587dbc (patch) | |
tree | 7065d31f967afeaeaf69cb717c83336094186b4a | |
parent | db19714b17e365d11ceb13e0d16c8cf3c837f38c (diff) |
[ruby/irb] Add dynamic prompt test case for quoted heredoc
(https://github.com/ruby/irb/pull/486)
https://github.com/ruby/irb/commit/31cfbeacbb
-rw-r--r-- | test/irb/test_ruby_lex.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/irb/test_ruby_lex.rb b/test/irb/test_ruby_lex.rb index 7802ffb4a6..3caa036ce5 100644 --- a/test/irb/test_ruby_lex.rb +++ b/test/irb/test_ruby_lex.rb @@ -212,6 +212,24 @@ module TestIRB assert_dynamic_prompt(lines, expected_prompt_list) end + def test_heredoc_prompt_with_quotes + input_with_prompt = [ + PromptRow.new("001:0:':* ", %q(<<~'A')), + PromptRow.new("002:0:':* ", %q(#{foobar})), + PromptRow.new("003:0: :> ", %q(A)), + PromptRow.new("004:0:`:* ", %q(<<~`A`)), + PromptRow.new("005:0:`:* ", %q(whoami)), + PromptRow.new("006:0: :> ", %q(A)), + PromptRow.new('007:0:":* ', %q(<<~"A")), + PromptRow.new('008:0:":* ', %q(foobar)), + PromptRow.new('009:0: :> ', %q(A)), + ] + + lines = input_with_prompt.map(&:content) + expected_prompt_list = input_with_prompt.map(&:prompt) + assert_dynamic_prompt(lines, expected_prompt_list) + end + def test_backtick_method input_with_prompt = [ PromptRow.new('001:0: :> ', %q(self.`(arg))), |