diff options
author | Nobuhiro IMAI <nov@yo.rim.or.jp> | 2020-03-24 15:24:01 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-02-03 00:09:32 +0900 |
commit | b0fb2082187fe3cd247a92471aa42d3e6f779e51 (patch) | |
tree | 80fa55d60240797084b0ed47336cf4df92ad6247 /test/irb/test_context.rb | |
parent | 739f9297c562a387aa012bad781ac2f07f434c1e (diff) | |
download | ruby-b0fb2082187fe3cd247a92471aa42d3e6f779e51.tar.gz |
[ruby/irb] follow up the actual line number
https://github.com/ruby/irb/commit/7aed8fe3b1
Diffstat (limited to 'test/irb/test_context.rb')
-rw-r--r-- | test/irb/test_context.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/irb/test_context.rb b/test/irb/test_context.rb index 63e71e5867..71e8ad1c0d 100644 --- a/test/irb/test_context.rb +++ b/test/irb/test_context.rb @@ -572,5 +572,26 @@ module TestIRB ensure $VERBOSE = verbose end + + def test_lineno + input = TestInputMethod.new([ + "\n", + "__LINE__\n", + "__LINE__\n", + "\n", + "\n", + "__LINE__\n", + ]) + irb = IRB::Irb.new(IRB::WorkSpace.new(Object.new), input) + out, err = capture_output do + irb.eval_input + end + assert_empty err + assert_pattern_list([ + :*, /\b2\n/, + :*, /\b3\n/, + :*, /\b6\n/, + ], out) + end end end |