aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_struct.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-28 12:36:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-28 12:36:27 +0000
commit1d223a3bdf2451701d79bf994fa7bedaf148f417 (patch)
treec939785fb5794272f8bbb6c02f6273e06914f7d1 /test/ruby/test_struct.rb
parentfd8f3cb98718be52976753e4580213b6062c2949 (diff)
downloadruby-1d223a3bdf2451701d79bf994fa7bedaf148f417.tar.gz
struct.c: avoid pinning down
* struct.c (rb_struct_set, rb_struct_aref, rb_struct_aset): get rid of pinning down dynamic symbols by SYM2ID. * struct.c (rb_struct_aref_sym, rb_struct_aset_sym): use Symbol instead of ID. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_struct.rb')
-rw-r--r--test/ruby/test_struct.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb
index 2acec57808..37366c317e 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -158,6 +158,8 @@ module TestStruct
assert_equal(1, o[0])
assert_raise(IndexError) { o[-2] }
assert_raise(IndexError) { o[1] }
+ assert_raise_with_message(NameError, /foo/) {o["foo"]}
+ assert_raise_with_message(NameError, /foo/) {o[:foo]}
end
def test_aset
@@ -167,6 +169,8 @@ module TestStruct
assert_equal(2, o[:a])
assert_raise(IndexError) { o[-2] = 3 }
assert_raise(IndexError) { o[1] = 3 }
+ assert_raise_with_message(NameError, /foo/) {o["foo"] = 3}
+ assert_raise_with_message(NameError, /foo/) {o[:foo] = 3}
end
def test_values_at