Merge branch 'tests' of github.com:pbosetti/mruby into tests

This commit is contained in:
Paolo Bosetti
2012-05-17 22:55:35 -07:00
3 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ end
# iso : The ISO reference code of the feature
# which will be tested by this
# assertion
def assert(str = 'Assertion failed', iso = '')
def assert(str = 'Assertion failed', iso = 'No ISO')
begin
if(!yield)
$asserts.push([str, iso])
+2 -3
View File
@@ -1,12 +1,11 @@
##
# Math Test
MATH_TOLERANCE = 1E-12
def check(a,b)
a = a.to_f
b = b.to_f
if a.finite? and b.finite?
(a-b).abs < MATH_TOLERANCE
(a-b).abs < Math::TOLERANCE
else
true
end
@@ -14,7 +13,7 @@ end
assert('Math.sin 0') do
check(Math.sin(0), 0)
check(Math.sin(0), 1)
end
assert('Math.sin PI/2') do