summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_literal.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
index 00adbff731..72dcce04e1 100644
--- a/test/ruby/test_literal.rb
+++ b/test/ruby/test_literal.rb
@@ -184,6 +184,11 @@ class TestRubyLiteral < Test::Unit::TestCase
list.each { |str| assert_predicate str, :frozen? }
end
+ def test_string_in_hash_literal
+ hash = eval("# frozen-string-literal: false\n""{foo: 'foo'}")
+ assert_not_predicate(hash[:foo], :frozen?)
+ end
+
if defined?(RubyVM::InstructionSequence.compile_option) and
RubyVM::InstructionSequence.compile_option.key?(:debug_frozen_string_literal)
def test_debug_frozen_string