summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-30 11:24:41 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-30 11:24:41 +0000
commit17b77906af339d53e1db838d41890d45476b7a53 (patch)
tree05424b860090cfc26c9a2a13d13d10db7312538d /test
parent2d909334c0a9ea6552c31691fea4baa733c0b04b (diff)
merge revision(s) 58825,58826: [Backport #5339]
erb.rb: Allow explicit trimming carriage return when trim_mode is "-", for Windows environments. [ruby-core:39625] [Bug #5339] erb.rb: Allow trimming CR in all trim_modes to unify a behavior with r58823 and r58825. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/erb/test_erb.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 3cdee60420..e40fb6b59a 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -200,6 +200,17 @@ EOS
def test_trim_line2_with_carriage_return
erb = @erb.new("<% 3.times do %>\r\nline\r\n<% end %>\r\n", nil, '<>')
assert_equal("line\r\n" * 3, erb.result)
+
+ erb = @erb.new("<% 3.times do %>\r\nline\r\n<% end %>\r\n", nil, '%<>')
+ assert_equal("line\r\n" * 3, erb.result)
+ end
+
+ def test_explicit_trim_line_with_carriage_return
+ erb = @erb.new("<%- 3.times do -%>\r\nline\r\n<%- end -%>\r\n", nil, '-')
+ assert_equal("line\r\n" * 3, erb.result)
+
+ erb = @erb.new("<%- 3.times do -%>\r\nline\r\n<%- end -%>\r\n", nil, '%-')
+ assert_equal("line\r\n" * 3, erb.result)
end
class Foo; end