summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraycabta <[email protected]>2021-04-03 00:46:01 +0900
committeraycabta <[email protected]>2021-04-03 01:15:46 +0900
commit254cd937c240281b4283bacb61b944eb52120ba5 (patch)
treed64d6c0d8e1c54ea6674b218bf5b9b60b9ed5c7d
parent0eb14919573379b86efc2cab79f0c2fb1b22923a (diff)
[ruby/irb] Add test for multiline paste
https://github.com/ruby/irb/commit/e93c9cb54d
-rw-r--r--test/irb/yamatanooroti/test_rendering.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/irb/yamatanooroti/test_rendering.rb b/test/irb/yamatanooroti/test_rendering.rb
index 19c6c9a9d3..171bfeaff5 100644
--- a/test/irb/yamatanooroti/test_rendering.rb
+++ b/test/irb/yamatanooroti/test_rendering.rb
@@ -42,6 +42,41 @@ begin
EOC
end
+ def test_multiline_paste
+ write_irbrc <<~'LINES'
+ puts 'start IRB'
+ LINES
+ start_terminal(25, 80, %W{ruby -I#{@pwd}/lib -I#{@pwd}/../reline/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
+ write(<<~EOC)
+ class A
+ def a; self; end
+ def b; true; end
+ end
+
+ a = A.new
+
+ a
+ .a
+ .b
+ EOC
+ close
+ assert_screen(<<~EOC)
+ start IRB
+ irb(main):001:1* class A
+ irb(main):002:1* def a; self; end
+ irb(main):003:1* def b; true; end
+ irb(main):004:0> end
+ irb(main):005:0*
+ irb(main):006:0> a = A.new
+ irb(main):007:0*
+ irb(main):008:0> a
+ irb(main):009:0> .a
+ irb(main):010:0> .b
+ => true
+ irb(main):011:0>
+ EOC
+ end
+
private def write_irbrc(content)
File.open(@irbrc_file, 'w') do |f|
f.write content