From fd25f13a2d424ca710e0458ba245ccdc919ac153 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 21 Aug 2019 16:47:13 +0100 Subject: [PATCH] add a test for the fix --- test/test-suite/test_arithmetic.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test-suite/test_arithmetic.py b/test/test-suite/test_arithmetic.py index eb3c15d8..b965991c 100644 --- a/test/test-suite/test_arithmetic.py +++ b/test/test-suite/test_arithmetic.py @@ -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)