Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test for handling invalid WKT with z values (refs #13055)
  • Loading branch information
nyalldawson committed Jul 16, 2015
1 parent 6de1a47 commit daa4d6a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/python/test_qgsgeometry.py
Expand Up @@ -1302,5 +1302,17 @@ def testRegression13053(self):
wkt = p.exportToWkt()
assert compareWkt( expWkt, wkt ), "testRegression13053 failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt )

def testRegression13055(self):
""" See http://hub.qgis.org/issues/13055
Testing that invalid WKT with z values but not using PolygonZ is still parsed
by QGIS.
"""
p = QgsGeometry.fromWkt('Polygon((0 0 0, 0 1 0, 1 1 0, 0 0 0 ))')
assert p is not None

expWkt ='Polygon ((0 0, 0 1, 1 1, 0 0))'
wkt = p.exportToWkt()
assert compareWkt( expWkt, wkt ), "testRegression13055 failed: mismatch Expected:\n%s\nGot:\n%s\n" % (expWkt, wkt )

if __name__ == '__main__':
unittest.main()

0 comments on commit daa4d6a

Please sign in to comment.