aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_struct.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-10 04:53:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-10 04:53:31 +0000
commit0dd8ec36c0533f1b63f222bcf0ff91e09e5b05dc (patch)
treeeb34a64fa5cfe7633472d92a98db73efbd2c65a0 /test/ruby/test_struct.rb
parent90749b1f2a87e89bd05e38f0078cf1d6eae71dc6 (diff)
downloadruby-0dd8ec36c0533f1b63f222bcf0ff91e09e5b05dc.tar.gz
parse.y: non-local/const attrset
* parse.y (rb_id_attrset): allow other than ID_ATTRSET. * parse.y (intern_str): ditto. try stem ID for ID_INSTANCE, ID_GLOBAL, ID_CLASS, ID_JUNK too. [Bug #8756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42490 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 c5ac2eb330..677452879c 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -132,6 +132,10 @@ class TestStruct < Test::Unit::TestCase
klass = Struct.new(:@a)
o = klass.new(1)
assert_equal("#<struct :@a=1>", o.inspect)
+ methods = klass.instance_methods(false)
+ assert_equal([:@a, :"@a="].inspect, methods.inspect, '[Bug #8756]')
+ assert_include(methods, :@a)
+ assert_include(methods, :"@a=")
end
def test_init_copy