diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-02-20 11:59:36 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-03-17 13:20:23 +0900 |
commit | 0d5b16599a4ad606619228623299b931c48b597b (patch) | |
tree | 9730cda98dc9b495ef54b38fcfc2570f3ee2f9c1 /test/ruby/test_parse.rb | |
parent | df5ef282337764508a1e1d93459d7a280e46647c (diff) |
[Bug #20218] Reject keyword arguments in index
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 051fac274f..a4ca08ec27 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -507,16 +507,16 @@ class TestParse < Test::Unit::TestCase end def t.dummy(_) end - eval <<-END, nil, __FILE__, __LINE__+1 + + assert_syntax_error("#{<<~"begin;"}\n#{<<~'end;'}", /block arg given in index/) + begin; t[42, &blk] ||= 42 - END - assert_equal([:aref, :aset], a) - a.clear - eval <<-END, nil, __FILE__, __LINE__+1 - t[42, &blk] ||= t.dummy 42 # command_asgn test - END - assert_equal([:aref, :aset], a) - blk + end; + + assert_syntax_error("#{<<~"begin;"}\n#{<<~'end;'}", /block arg given in index/) + begin; + t[42, &blk] ||= t.dummy 42 # command_asgn test + end; end def test_backquote |