diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-19 05:30:02 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-19 05:30:02 +0000 |
commit | 1e27eda2fa313865bda1246175b3d6ebfe8cc533 (patch) | |
tree | 94fbb607c2b3c5ef62552d6c35606aa54bb70a10 /test | |
parent | 92cd831366482bd0737bbd32ea3752e41050de88 (diff) | |
download | ruby-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')
-rw-r--r-- | test/ruby/test_eval.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_symbol.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb index edbda38818..cba9ce42f8 100644 --- a/test/ruby/test_eval.rb +++ b/test/ruby/test_eval.rb @@ -128,7 +128,7 @@ class TestEval < Test::Unit::TestCase end def forall_TYPE - objects = [Object.new, [], nil, true, false, :sym] # TODO: check + objects = [Object.new, [], nil, true, false] # TODO: check objects.each do |obj| obj.instance_variable_set :@ivar, 12 yield obj 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 |