add a few more filter tests - all should pass cleanly
This commit is contained in:
parent
c38598e9ad
commit
9e8f815b07
1 changed files with 22 additions and 0 deletions
|
@ -124,5 +124,27 @@ def test_unicode_regex_replace():
|
|||
expr = mapnik.Expression("[name].replace('(\B)|( )','$1 ')")
|
||||
eq_(expr.evaluate(f), u'Q u é b e c')
|
||||
|
||||
def test_float_precision():
|
||||
context = mapnik.Context()
|
||||
context.push('num')
|
||||
f = mapnik.Feature(context,0)
|
||||
f["num"] = 1.0000
|
||||
eq_(f["num"],1.0000)
|
||||
expr = mapnik.Expression("[num] = 1.0000")
|
||||
eq_(expr.evaluate(f),True)
|
||||
expr = mapnik.Expression("[num].match('.*0$')")
|
||||
eq_(expr.evaluate(f),True)
|
||||
expr = mapnik.Expression("[num].match('.*0$')")
|
||||
eq_(expr.evaluate(f),True)
|
||||
|
||||
def test_string_matching_on_precision():
|
||||
context = mapnik.Context()
|
||||
context.push('num')
|
||||
f = mapnik.Feature(context,0)
|
||||
f["num"] = "1.0000"
|
||||
eq_(f["num"],"1.0000")
|
||||
expr = mapnik.Expression("[num].match('.*(^0|00)$')")
|
||||
eq_(expr.evaluate(f),True)
|
||||
|
||||
if __name__ == "__main__":
|
||||
[eval(run)() for run in dir() if 'test_' in run]
|
||||
|
|
Loading…
Add table
Reference in a new issue