diff options
author | aycabta <aycabta@gmail.com> | 2021-02-06 21:07:11 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-02-06 21:09:31 +0900 |
commit | 7b354cf67ba95305b600cc8b3ba684923cdc5a98 (patch) | |
tree | b6215c4c41cf913f4ceb8353d205414486939515 /test/irb | |
parent | 5704b5fe5e42bd5b1f42a27368cd5d52dd5a9060 (diff) |
[ruby/irb] Enable to reassign a new block with "measure" command
https://github.com/ruby/irb/commit/b444573aa2
Diffstat (limited to 'test/irb')
-rw-r--r-- | test/irb/test_cmd.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb index 045ce0f0e7..7219473e4c 100644 --- a/test/irb/test_cmd.rb +++ b/test/irb/test_cmd.rb @@ -294,6 +294,13 @@ module TestIRB "measure { |context, code, line_no, &block|\n", " result = block.()\n", " puts 'aaa' if IRB.conf[:MEASURE]\n", + " result\n", + "}\n", + "3\n", + "measure { |context, code, line_no, &block|\n", + " result = block.()\n", + " puts 'bbb' if IRB.conf[:MEASURE]\n", + " result\n", "}\n", "3\n", "measure :off\n", @@ -306,7 +313,7 @@ module TestIRB irb.eval_input end assert_empty err - assert_match(/\A=> 3\nBLOCK is added\.\n=> nil\naaa\n=> 3\n=> nil\n=> 3\n/, out) + assert_match(/\A=> 3\nBLOCK is added\.\n=> nil\naaa\n=> 3\nBLOCK is added.\naaa\n=> nil\nbbb\n=> 3\n=> nil\n=> 3\n/, out) assert_empty(c.class_variables) end |