Skip to content

Commit bf7aaf4

Browse files
committed
test: use assert_in_delta for floats returned from db funcs
because truffleruby is rounding
1 parent 048115d commit bf7aaf4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test/test_database.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,10 @@ def test_call_func_arg_type
360360
nil
361361
end
362362
@db.execute("select hello(2.2, 'foo', NULL)")
363-
assert_equal [2.2, 'foo', nil], called_with
363+
364+
assert_in_delta(2.2, called_with[0], 0.0001)
365+
assert_equal("foo", called_with[1])
366+
assert_nil(called_with[2])
364367
end
365368

366369
def test_define_varargs
@@ -370,7 +373,10 @@ def test_define_varargs
370373
nil
371374
end
372375
@db.execute("select hello(2.2, 'foo', NULL)")
373-
assert_equal [2.2, 'foo', nil], called_with
376+
377+
assert_in_delta(2.2, called_with[0], 0.0001)
378+
assert_equal("foo", called_with[1])
379+
assert_nil(called_with[2])
374380
end
375381

376382
def test_call_func_blob

0 commit comments

Comments
 (0)