mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add assert_float to test environment
This commit is contained in:
@@ -178,6 +178,14 @@ def assert_kind_of(cls, obj, msg = nil)
|
||||
assert_true(obj.kind_of?(cls), msg, diff)
|
||||
end
|
||||
|
||||
##
|
||||
# Fails unless +exp+ is equal to +act+ in terms of a Float
|
||||
def assert_float(exp, act, msg = nil)
|
||||
msg = "Float #{exp} expected to be equal to float #{act}" unless msg
|
||||
diff = assertion_diff(exp, act)
|
||||
assert_true check_float(exp, act), msg, diff
|
||||
end
|
||||
|
||||
##
|
||||
# Report the test result and print all assertions
|
||||
# which were reported broken.
|
||||
|
||||
Reference in New Issue
Block a user