Some cosmetic changes

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-11-22 16:09:50 +09:00
parent 284a1d12ee
commit b4f9b031de
6 changed files with 32 additions and 32 deletions
+1 -1
View File
@@ -336,7 +336,7 @@ end
assert('BS Block 28') do
assert_equal(10) do
3.times{|bl|
3.times{
break 10
}
end
+7 -7
View File
@@ -8,7 +8,7 @@
#
# For example, the following mruby code:
#
# if i > 0 and i < 10 then
# if i > 0 and i < 10
#
# compiles to the following byte code:
#
@@ -27,21 +27,21 @@
assert('and', '11.2.3') do
a = 1
if a > 0 and a < 10 then
if a > 0 and a < 10
b = 1
else
b = 0
end
assert_equal 1, b
if a < 0 and a < 10 then
if a < 0 and a < 10
b = 1
else
b = 0
end
assert_equal 0, b
if a < 0 and a > 10 then
if a < 0 and a > 10
b = 1
else
b = 0
@@ -51,21 +51,21 @@ end
assert('or','11.2.4') do
a = 1
if a > 0 or a < 10 then
if a > 0 or a < 10
b = 1
else
b = 0
end
assert_equal 1, b
if a < 0 or a < 10 then
if a < 0 or a < 10
b = 1
else
b = 0
end
assert_equal 1, b
if a < 0 or a > 10 then
if a < 0 or a > 10
b = 1
else
b = 0
+2 -2
View File
@@ -367,9 +367,9 @@ assert('String#gsub', '15.2.10.5.18') do
assert_equal('aBcaBc', 'abcabc'.gsub('b', 'B'), 'gsub without block')
assert_equal('aBcaBc', 'abcabc'.gsub('b'){|w| w.capitalize }, 'gsub with block')
assert_equal('$a$a$', '#a#a#'.gsub('#', '$'), 'mruby/mruby#847')
assert_equal('$a$a$', '#a#a#'.gsub('#'){|w| '$' }, 'mruby/mruby#847 with block')
assert_equal('$a$a$', '#a#a#'.gsub('#'){|_w| '$' }, 'mruby/mruby#847 with block')
assert_equal('$$a$$', '##a##'.gsub('##', '$$'), 'mruby/mruby#847 another case')
assert_equal('$$a$$', '##a##'.gsub('##'){|w| '$$' }, 'mruby/mruby#847 another case with block')
assert_equal('$$a$$', '##a##'.gsub('##'){|_w| '$$' }, 'mruby/mruby#847 another case with block')
assert_equal('A', 'a'.gsub('a', 'A'))
assert_equal('A', 'a'.gsub('a'){|w| w.capitalize })
assert_equal("<a><><>", 'a'.gsub('a', '<\0><\1><\2>'))