aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-23 06:16:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-23 06:16:04 +0000
commit11e6bd5ac2a2eebfa589bd6db8c9c4daa337733e (patch)
tree2b0fc5c072aabb9716bcb3be2639f131540b49bf /test
parent5bb125c63e3bbbe6b92c43f8e1b4017eab97721f (diff)
downloadruby-11e6bd5ac2a2eebfa589bd6db8c9c4daa337733e.tar.gz
object.c: no TypeError at Symbol
* object.c (special_object_p): uninterned Symbol also should not raise a TypeError but return itself instead, as well as interned Symbols. [ruby-core:79216] [Bug #13145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_object.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index c1721de39c..7c1b98f76e 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -23,6 +23,8 @@ class TestObject < Test::Unit::TestCase
assert_equal true, true.dup
assert_equal nil, nil.dup
assert_equal false, false.dup
+ x = :x; assert_equal x, x.dup
+ x = "bug13145".intern; assert_equal x, x.dup
x = 1 << 64; assert_equal x, x.dup
x = 1.72723e-77; assert_equal x, x.dup
@@ -51,6 +53,8 @@ class TestObject < Test::Unit::TestCase
assert_equal true, true.clone
assert_equal nil, nil.clone
assert_equal false, false.clone
+ x = :x; assert_equal x, x.dup
+ x = "bug13145".intern; assert_equal x, x.dup
x = 1 << 64; assert_equal x, x.clone
x = 1.72723e-77; assert_equal x, x.clone
assert_raise(ArgumentError) {1.clone(freeze: false)}