diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-16 18:38:48 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-16 18:38:48 +0900 |
commit | c171ab23e376b6c7f1094a77f137d916b0a403e6 (patch) | |
tree | e6306df59e96d5d70aa4172d19c91e47e5b753a2 /test | |
parent | f38b3e8c707ebdcad05aa9485cf1760640b74fbb (diff) | |
download | ruby-c171ab23e376b6c7f1094a77f137d916b0a403e6.tar.gz |
Separate numbered parameter scope in eval
[Feature #16432]
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_syntax.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index b93062cf2d..5591b7cb31 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1450,7 +1450,13 @@ eom assert_valid_syntax("->{_1;#{c};->{_1};end}\n") end - 1.times {_1} + 1.times { + [ + _1, + assert_equal([:a], eval("[:a].map{_1}")), + assert_raise(NameError) {eval("_1")}, + ] + } end def test_value_expr_in_condition |