summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-22 02:52:48 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-22 02:52:48 +0000
commitf9e621372df2551fa269f3c814246eca1e34e4fb (patch)
tree0a2df5670874674217d66c25d9f5dbaf3c757e6e /test/ruby
parent570b766901c1a80f5a317012eb81ee9d1f301073 (diff)
* struct.c (make_struct): remove junk ID check to allow members who
have junk name like "foo\000". * test/ruby/test_struct.rb: Test for above. [Bug #7575] [ruby-dev:46750] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_struct.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb
index 03cb55999c..1c108777ee 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -227,6 +227,13 @@ class TestStruct < Test::Unit::TestCase
assert_equal("#<struct Struct::R\u{e9}sum\u{e9} r\u{e9}sum\u{e9}=42>", a.inspect, '[ruby-core:24849]')
end
+ def test_junk
+ struct_test = Struct.new("Foo", "a\000")
+ o = struct_test.new(1)
+ assert_equal(1, o.send("a\000"))
+ Struct.instance_eval { remove_const(:Foo) }
+ end
+
def test_comparison_when_recursive
klass1 = Struct.new(:a, :b, :c)