aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
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