1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-08-10 04:53:31 +00:00
parent 90749b1f2a
commit 0dd8ec36c0
3 changed files with 42 additions and 21 deletions

View file

@ -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