1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* compile.c (compile_dstr_fragments): reduced needless literal.

* parse.y (xstring, regexp, dsym, literal_concat, evstr2dstr):
  literal at the top of dstr is no longer needed if it is empty,
  since concatstrings and toregexp always create new strings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-07-20 10:01:05 +00:00
parent abc20ed0f4
commit 5a392c71db
4 changed files with 25 additions and 10 deletions

View file

@ -59,6 +59,10 @@ class TestRubyLiteral < Test::Unit::TestCase
assert_equal '16', "#{2 ** 4}"
s = "string"
assert_equal s, "#{s}"
a = 'Foo'
b = "#{a}" << 'Bar'
assert_equal('Foo', a, 'r3842')
assert_equal('FooBar', b, 'r3842')
end
def test_dsymbol