summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-20 10:01:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-20 10:01:05 +0000
commit864a7edc4902e07108de1f5d242484497a2e0011 (patch)
tree669c874771eb57da68840d114b456ce247a81067 /test/ruby
parent4fd60c8a768eb99801ffa54ae93c1336fa73241a (diff)
downloadruby-864a7edc4902e07108de1f5d242484497a2e0011.tar.gz
ruby-864a7edc4902e07108de1f5d242484497a2e0011.tar.xz
ruby-864a7edc4902e07108de1f5d242484497a2e0011.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@24212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_literal.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
index e87769a6c..52f770494 100644
--- a/test/ruby/test_literal.rb
+++ b/test/ruby/test_literal.rb
@@ -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