aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-27 12:40:03 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-27 12:40:03 +0000
commit138bab4c24836858102d84956359e955857c7055 (patch)
treec3a192737efcb7780479bf74a8698e01b65964bc /test
parent521d5bff082732bdce50b7757da0dba6f2573a61 (diff)
downloadruby-138bab4c24836858102d84956359e955857c7055.tar.gz
erb.rb: preserve the behavior for invalid syntax
comment. Fix regression at r58948. I even don't want to deprecate it because deprecation needs to lex all embedded Ruby script using Ripper and it would be slow. So Let me just keep this behavior of Ruby 2.4. No change is the best compatibility. This commit stopped using String#-@ because it's harmful for "ambiguous first argument" warning if we really want to maintain this behavior. [Bug #14243] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/erb/test_erb.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 46f81c778b..045ce5129b 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -622,6 +622,13 @@ EOS
erb = @erb.new("<%= 1 %>")
assert_raise(TypeError) { erb.result_with_hash({ 1 => "1" }) }
end
+
+ # Bug#14243
+ def test_half_working_comment_backward_compatibility
+ assert_nothing_raised do
+ @erb.new("<% # comment %>\n").result
+ end
+ end
end
class TestERBCoreWOStrScan < TestERBCore