add a test for the fix

This commit is contained in:
John Cupitt 2019-08-21 16:47:13 +01:00
parent 0b3ece5b42
commit fd25f13a2d
1 changed files with 7 additions and 0 deletions

View File

@ -202,6 +202,13 @@ class TestArithmetic:
self.run_arith_const(noteq)
self.run_arith(noteq)
# comparisons against out of range values should always fail, and
# comparisons to fractional values should always fail
x = pyvips.Image.grey(256, 256, uchar=True)
assert (x == 1000).max() == 0
assert (x == 12).max() == 255
assert (x == 12.5).max() == 0
def test_abs(self):
def my_abs(x):
return abs(x)