summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorFUKUZAWA-Tadashi <[email protected]>2013-03-17 21:22:21 +0900
committerFUKUZAWA-Tadashi <[email protected]>2013-03-17 21:27:38 +0900
commit76c24894a7f859cc76b437a07030f2e2f277eab1 (patch)
tree3241bc03ca6b83ffa9f1c83e0e23a420ea946350 /test
parent41698100adc7906f2a14b3f8df73e0277e85e2f6 (diff)
downloadmruby-76c24894a7f859cc76b437a07030f2e2f277eab1.tar.gz
mruby-76c24894a7f859cc76b437a07030f2e2f277eab1.zip
bugfix about escaping '\n'
Diffstat (limited to 'test')
-rw-r--r--test/t/literals.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/t/literals.rb b/test/t/literals.rb
index 5dc15f135..5a29cff0c 100644
--- a/test/t/literals.rb
+++ b/test/t/literals.rb
@@ -140,6 +140,11 @@ assert('Literals Array', '8.7.6.4') do
#{-1}1
2#{2}
}
+ h = %W(a\nb
+ test\ abc
+ c\
+d
+ x\y x\\y x\\\y)
test1 = (a == ['abc3def', '}g'] and
b == ['abc', '5', 'def', '(g'] and
@@ -147,7 +152,8 @@ assert('Literals Array', '8.7.6.4') do
d == ['9'] and
e == [] and
f == ['[ab', 'cd][ef]'] and
- g == ['ab', '-11', '22']
+ g == ['ab', '-11', '22'] and
+ h == ["a\nb", 'test abc', "c\nd", "xy", "x\\y", "x\\y"]
)
a = %w{abc#{1+2}def \}g}
@@ -161,6 +167,11 @@ assert('Literals Array', '8.7.6.4') do
#{-1}1
2#{2}
}
+ h = %w(a\nb
+ test\ abc
+ c\
+d
+ x\y x\\y x\\\y)
test2 = (a == ['abc#{1+2}def', '}g'] and
b == ['abc', '#{2+3}', 'def', '(g'] and
@@ -168,8 +179,9 @@ assert('Literals Array', '8.7.6.4') do
d == ['#{4+5}'] and
e == [] and
f == ['[ab', 'cd][ef]'] and
- g == ['ab', '#{-1}1', '2#{2}']
- )
+ g == ['ab', '#{-1}1', '2#{2}'] and
+ h == ["a\\nb", "test abc", "c\nd", "x\\y", "x\\y", "x\\\\y"]
+ )
test1 and test2
end