diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-09 03:58:34 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-09 03:58:34 +0000 |
commit | 88b035b80f5d9de3c1d8d8ea4d79fd699a618fc5 (patch) | |
tree | 55861ba08e71fa5dc088e310deb32b4e6ccea37f /test | |
parent | 158de1238a0ac38cda4e82c1640707dbf2099d9f (diff) | |
download | ruby-88b035b80f5d9de3c1d8d8ea4d79fd699a618fc5.tar.gz |
* compile.c (iseq_compile_each): Dynamic string literals (e.g.,
"#{x}") should not be frozen because they don't literally
represent strings.
https://twitter.com/shugomaeda/status/651937650027401216
https://twitter.com/yukihiro_matz/status/651942882312482817
https://twitter.com/yukihiro_matz/status/651980835181096960
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_iseq.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 72b9c4ae3a..e6028da488 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -166,12 +166,13 @@ class TestISeq < Test::Unit::TestCase $f = 'f' line = __LINE__ + 2 code = <<-'EOS' - ['foo', 'foo', "#{$f}foo"] + ['foo', 'foo', "#{$f}foo", "#{'foo'}"] EOS - s1, s2, s3 = RubyVM::InstructionSequence.compile(code, __FILE__, __FILE__, line, {frozen_string_literal: true}).eval - assert(s1.frozen?) - assert(s2.frozen?) - assert(s3.frozen?) - assert(s1.object_id == s2.object_id) + s1, s2, s3, s4 = RubyVM::InstructionSequence.compile(code, __FILE__, __FILE__, line, {frozen_string_literal: true}).eval + assert_equal(true, s1.frozen?) + assert_equal(true, s2.frozen?) + assert_equal(false, s3.frozen?) + assert_equal(true, s4.frozen?) + assert_equal(s2.object_id, s2.object_id) end end |