From 1f81ee09d4999bca5a9a6cdd2ef50f8350a0b11c Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 17 Jun 2014 22:19:17 -0700 Subject: [PATCH] add test for #2240 --- tests/python_tests/filter_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/python_tests/filter_test.py b/tests/python_tests/filter_test.py index 31fb02969..3ad2a343e 100644 --- a/tests/python_tests/filter_test.py +++ b/tests/python_tests/filter_test.py @@ -431,6 +431,15 @@ def test_truthyness_comparision(): eq_(mapnik.Expression("[prop] = true").to_bool(f),True) eq_(mapnik.Expression("[prop] != true").to_bool(f),False) +def test_division_by_zero(): + expr = mapnik.Expression('[a]/[b]') + c = mapnik.Context() + c.push('a') + c.push('b') + f = mapnik.Feature(c,0); + f['a'] = 1 + f['b'] = 0 + eq_(expr.evaluate(f),None) if __name__ == "__main__": run_all(eval(x) for x in dir() if x.startswith("test_"))