summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-16 18:38:48 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-16 18:38:48 +0900
commitc171ab23e376b6c7f1094a77f137d916b0a403e6 (patch)
treee6306df59e96d5d70aa4172d19c91e47e5b753a2 /test
parentf38b3e8c707ebdcad05aa9485cf1760640b74fbb (diff)
downloadruby-c171ab23e376b6c7f1094a77f137d916b0a403e6.tar.gz
Separate numbered parameter scope in eval
[Feature #16432]
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_syntax.rb8
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