aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-19 05:30:02 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-19 05:30:02 +0000
commit1e27eda2fa313865bda1246175b3d6ebfe8cc533 (patch)
tree94fbb607c2b3c5ef62552d6c35606aa54bb70a10 /test/ruby/test_symbol.rb
parent92cd831366482bd0737bbd32ea3752e41050de88 (diff)
downloadruby-1e27eda2fa313865bda1246175b3d6ebfe8cc533.tar.gz
* include/ruby/ruby.h: make Symbol objects frozen.
[Feature #8906] I want to freeze this good day, too. * test/ruby/test_eval.rb: catch up this change. * test/ruby/test_symbol.rb: add a test to check frozen symbols. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 214158e864..7f261b68bb 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -198,4 +198,12 @@ class TestSymbol < Test::Unit::TestCase
def test_singleton_method
assert_raise(TypeError) { a = :foo; def a.foo; end }
end
+
+ def test_frozen_symbol
+ assert_equal(true, :foo.frozen?)
+ assert_equal(true, :each.frozen?)
+ assert_equal(true, :+.frozen?)
+ assert_equal(true, "foo#{Time.now.to_i}".to_sym.frozen?)
+ assert_equal(true, :foo.to_sym.frozen?)
+ end
end