summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-15 14:53:00 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-15 14:53:00 +0000
commitf9acab1f4298f909624440d98996ffe1b7b6da82 (patch)
tree0628d29da1cfce380822fcc89a579fd333eb7c05 /test
parent4f8090c71cca18a8f7c1b923f398cc9d6712f810 (diff)
merge revision(s) r44926: [Backport #8756] [Backport #9248]
* parse.y (IDSET_ATTRSET_FOR_INTERN): fix off-by-one bug. * parse.y (rb_enc_symname_type): junk ID succeeded by '=' is also attrset ID. [ruby-core:60668] [Bug #8756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/symbol/test_type.rb4
-rw-r--r--test/ruby/test_struct.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/test/-ext-/symbol/test_type.rb b/test/-ext-/symbol/test_type.rb
index d6816754c8..034d8bc0fd 100644
--- a/test/-ext-/symbol/test_type.rb
+++ b/test/-ext-/symbol/test_type.rb
@@ -105,6 +105,10 @@ module Test_Symbol
assert_equal(:"[foo]=", Bug::Symbol.attrset("[foo]"))
assert_symtype(Bug::Symbol.attrset("[foo]"), :attrset?)
assert_equal(:[]=, Bug::Symbol.attrset(:[]))
+ assert_symtype(Bug::Symbol.attrset("foo?="), :attrset?)
+ assert_equal(:"foo?=", Bug::Symbol.attrset(:foo?))
+ assert_symtype(Bug::Symbol.attrset("foo!="), :attrset?)
+ assert_equal(:"foo!=", Bug::Symbol.attrset(:foo!))
end
end
end
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb
index ee8bf3184a..72cb5f480b 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -319,6 +319,8 @@ module TestStruct
x = Object.new
o = klass.new("test", x)
assert_same(x, o.b?)
+ o.send("b?=", 42)
+ assert_equal(42, o.b?)
end
def test_bang_mark_in_member
@@ -326,6 +328,8 @@ module TestStruct
x = Object.new
o = klass.new("test", x)
assert_same(x, o.b!)
+ o.send("b!=", 42)
+ assert_equal(42, o.b!)
end
class TopStruct < Test::Unit::TestCase