summaryrefslogtreecommitdiff
path: root/test/irb/yamatanooroti/test_rendering.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/irb/yamatanooroti/test_rendering.rb')
-rw-r--r--test/irb/yamatanooroti/test_rendering.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/irb/yamatanooroti/test_rendering.rb b/test/irb/yamatanooroti/test_rendering.rb
index 7ed98b11c1..f9a130b7d4 100644
--- a/test/irb/yamatanooroti/test_rendering.rb
+++ b/test/irb/yamatanooroti/test_rendering.rb
@@ -216,6 +216,25 @@ begin
EOC
end
+ def test_assignment_expression_truncate
+ write_irbrc <<~'LINES'
+ puts 'start IRB'
+ LINES
+ start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
+ # Assignment expression code that turns into non-assignment expression after evaluation
+ code = "a /'/i if false; a=1; x=1000.times.to_a#'.size"
+ write(code + "\n")
+ close
+ assert_screen(<<~EOC)
+ start IRB
+ irb(main):001:0> #{code}
+ =>
+ [0,
+ ...
+ irb(main):002:0>
+ EOC
+ end
+
private def write_irbrc(content)
File.open(@irbrc_file, 'w') do |f|
f.write content