mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Some cosmetic changes
This commit is contained in:
+1
-1
@@ -336,7 +336,7 @@ end
|
||||
|
||||
assert('BS Block 28') do
|
||||
assert_equal(10) do
|
||||
3.times{|bl|
|
||||
3.times{
|
||||
break 10
|
||||
}
|
||||
end
|
||||
|
||||
+7
-7
@@ -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
@@ -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>'))
|
||||
|
||||
Reference in New Issue
Block a user