diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-27 21:38:54 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-27 21:38:54 +0000 |
commit | aad72320354dd5893e49b91952789c5163beb6b2 (patch) | |
tree | d2abb1379e41ef05002a160b40c8c343cd49fffe /test | |
parent | 950fd771fb8908968cce67a38fdde69ef0cd2b80 (diff) |
merge revision(s) 51820: [Backport #11519]
* parse.y (literal_concat_gen, evstr2dstr_gen): keep literal
encoding beginning with an interpolation same as the source file
encoding. [ruby-core:70703] [Bug #11519]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_literal.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb index ed5f83655c..302f487bb6 100644 --- a/test/ruby/test_literal.rb +++ b/test/ruby/test_literal.rb @@ -102,6 +102,15 @@ class TestRubyLiteral < Test::Unit::TestCase assert_equal('FooBar', b, 'r3842') end + def test_dstring_encoding + bug11519 = '[ruby-core:70703] [Bug #11519]' + ['"foo#{}"', '"#{}foo"', '"#{}"'].each do |code| + a = eval("#-*- coding: utf-8 -*-\n#{code}") + assert_equal(Encoding::UTF_8, a.encoding, + proc{"#{bug11519}: #{code}.encoding"}) + end + end + def test_dsymbol assert_equal :a3c, :"a#{1+2}c" end |