mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
test t/*.rb spacing fix
This commit is contained in:
+4
-4
@@ -83,7 +83,7 @@ end
|
||||
assert('Array#index', '15.2.12.5.14') do
|
||||
a = [1,2,3]
|
||||
|
||||
a.index(2) == 1
|
||||
a.index(2) == 1
|
||||
end
|
||||
|
||||
assert('Array#initialize', '15.2.12.5.15') do
|
||||
@@ -99,7 +99,7 @@ assert('Array#initialize_copy', '15.2.12.5.16') do
|
||||
a = [1,2,3]
|
||||
b = [].initialize_copy(a)
|
||||
|
||||
b == [1,2,3]
|
||||
b == [1,2,3]
|
||||
end
|
||||
|
||||
assert('Array#join', '15.2.12.5.17') do
|
||||
@@ -165,7 +165,7 @@ end
|
||||
assert('Array#rindex', '15.2.12.5.26') do
|
||||
a = [1,2,3]
|
||||
|
||||
a.rindex(2) == 1
|
||||
a.rindex(2) == 1
|
||||
end
|
||||
|
||||
assert('Array#shift', '15.2.12.5.27') do
|
||||
@@ -178,7 +178,7 @@ end
|
||||
assert('Array#size', '15.2.12.5.28') do
|
||||
a = [1,2,3]
|
||||
|
||||
a.size == 3
|
||||
a.size == 3
|
||||
end
|
||||
|
||||
assert('Array#slice', '15.2.12.5.29') do
|
||||
|
||||
+7
-7
@@ -9,7 +9,7 @@ assert('Float#+', '15.2.9.3.1') do
|
||||
a = 3.123456788 + 0.000000001
|
||||
b = 3.123456789 + 1
|
||||
|
||||
check_float(a, 3.123456789) and
|
||||
check_float(a, 3.123456789) and
|
||||
check_float(b, 4.123456789)
|
||||
end
|
||||
|
||||
@@ -17,8 +17,8 @@ assert('Float#-', '15.2.9.3.2') do
|
||||
a = 3.123456790 - 0.000000001
|
||||
b = 5.123456789 - 1
|
||||
|
||||
check_float(a, 3.123456789) and
|
||||
check_float(b, 4.123456789)
|
||||
check_float(a, 3.123456789) and
|
||||
check_float(b, 4.123456789)
|
||||
end
|
||||
|
||||
assert('Float#*', '15.2.9.3.3') do
|
||||
@@ -47,17 +47,17 @@ end
|
||||
|
||||
assert('Float#<=>', '15.2.9.3.6') do
|
||||
a = 3.123456789 <=> 3.123456788
|
||||
b = 3.123456789 <=> 3.123456789
|
||||
b = 3.123456789 <=> 3.123456789
|
||||
c = 3.123456789 <=> 3.123456790
|
||||
a2 = 3.123456789 <=> 3
|
||||
c2 = 3.123456789 <=> 4
|
||||
|
||||
|
||||
a == 1 and b == 0 and c == -1 and
|
||||
a2 == 1 and c2 == -1
|
||||
end
|
||||
|
||||
assert('Float#==', '15.2.9.3.7') do
|
||||
3.1 == 3.1 and not (3.1 == 3.2)
|
||||
3.1 == 3.1 and not 3.1 == 3.2
|
||||
end
|
||||
|
||||
assert('Float#ceil', '15.2.9.3.8') do
|
||||
@@ -74,7 +74,7 @@ assert('Float#floor', '15.2.9.3.10') do
|
||||
end
|
||||
|
||||
assert('Float#infinite?', '15.2.9.3.11') do
|
||||
not 3.123456789.infinite? and
|
||||
not 3.123456789.infinite? and
|
||||
(1.0 / 0.0).infinite?
|
||||
end
|
||||
|
||||
|
||||
+4
-4
@@ -169,17 +169,17 @@ assert('Hash#member?', '15.2.13.4.21') do
|
||||
end
|
||||
|
||||
assert('Hash#merge', '15.2.13.4.22') do
|
||||
a = { 'abc_key' => 'abc_value', 'cba_key' => 'cba_value' }
|
||||
b = { 'cba_key' => 'XXX', 'xyz_key' => 'xyz_value' }
|
||||
a = { 'abc_key' => 'abc_value', 'cba_key' => 'cba_value' }
|
||||
b = { 'cba_key' => 'XXX', 'xyz_key' => 'xyz_value' }
|
||||
|
||||
result_1 = a.merge b
|
||||
result_2 = a.merge(b) do |key, original, new|
|
||||
original
|
||||
end
|
||||
|
||||
result_1 == {'abc_key' => 'abc_value', 'cba_key' => 'XXX',
|
||||
result_1 == {'abc_key' => 'abc_value', 'cba_key' => 'XXX',
|
||||
'xyz_key' => 'xyz_value' } and
|
||||
result_2 == {'abc_key' => 'abc_value', 'cba_key' => 'cba_value',
|
||||
result_2 == {'abc_key' => 'abc_value', 'cba_key' => 'cba_value',
|
||||
'xyz_key' => 'xyz_value' }
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ assert('Integer#downto', '15.2.8.3.15') do
|
||||
3.downto(1) do |i|
|
||||
a += i
|
||||
end
|
||||
a == 6
|
||||
a == 6
|
||||
end
|
||||
|
||||
assert('Integer#eql?', '15.2.8.3.16') do
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ assert('Math.sin PI/2') do
|
||||
end
|
||||
|
||||
|
||||
assert('Fundamental trig identities') do
|
||||
assert('Fundamental trig identities') do
|
||||
result = true
|
||||
N = 15
|
||||
N.times do |i|
|
||||
@@ -26,7 +26,7 @@ assert('Fundamental trig identities') do
|
||||
result &= check_float((1/t) ** 2 + 1, (1/s) ** 2)
|
||||
end
|
||||
result
|
||||
end
|
||||
end
|
||||
|
||||
assert('Math.erf 0') do
|
||||
check_float(Math.erf(0), 0)
|
||||
|
||||
+2
-2
@@ -115,7 +115,7 @@ end
|
||||
assert('String#chop!', '15.2.10.5.12') do
|
||||
a = ''
|
||||
b = 'abc'
|
||||
|
||||
|
||||
a.chop!
|
||||
b.chop!
|
||||
|
||||
@@ -147,7 +147,7 @@ assert('String#each_line', '15.2.10.5.15') do
|
||||
a.each_line do |line|
|
||||
n_list << line
|
||||
end
|
||||
|
||||
|
||||
list == n_list
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user