summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-02 11:07:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-02 11:07:13 +0000
commitdbf73f6fc2a4b0414110eea64a9f98d33c2cf930 (patch)
tree606aca9469e74b35385f3f53d6dbdadff28f5bde /test
parent840e6b63077347be513037f083056886eaf90732 (diff)
parse.y: lbracket
* parse.y (lbracket): support .? before aref. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_call.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb
index 12793a7572..d30890d6a1 100644
--- a/test/ruby/test_call.rb
+++ b/test/ruby/test_call.rb
@@ -46,9 +46,13 @@ class TestCall < Test::Unit::TestCase
assert_equal(5, o.y)
o.?z ||= 6
assert_equal(6, o.z)
+ assert_equal(42, o.?[:x])
+ assert_equal(42, o.?["x"])
o = nil
assert_nil(o.?x)
+ assert_nil(o.?[:x])
+ assert_nil(o.?["x"])
assert_nothing_raised(NoMethodError) {o.?x = 6}
assert_nothing_raised(NoMethodError) {o.?x *= 7}
end