Skip to content
Permalink
Browse files

Better string

  • Loading branch information
nyalldawson committed Oct 16, 2020
1 parent 41a30ac commit cf6707657e106c49685708f5c7c043db55151fba
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/core/qgsgeometryvalidator.cpp
  2. +3 −3 tests/src/python/test_qgsgeometryvalidator.py
@@ -149,7 +149,7 @@ void QgsGeometryValidator::validatePolyline( int i, const QgsLineString *line, b

j -= n - 1;

QString msg = QObject::tr( "line %1 contains %n duplicate node(s) starting at vertex %2", "number of duplicate nodes", n + 1 ).arg( i + 1 ).arg( duplicateVertex.vertex - n + 1 );
QString msg = QObject::tr( "line %1 contains %n duplicate nodes starting at vertex %2", "number of duplicate nodes", n + 1 ).arg( i + 1 ).arg( duplicateVertex.vertex - n + 1 );
QgsDebugMsgLevel( msg, 2 );
emit errorFound( QgsGeometry::Error( msg, duplicationLocation ) );
mErrorCount++;
@@ -75,13 +75,13 @@ def test_linestring_duplicate_nodes(self):

self.assertEqual(len(spy), 3)
self.assertEqual(spy[0][0].where(), QgsPointXY(1, 6))
self.assertEqual(spy[0][0].what(), 'line 1 contains 2 duplicate node(s) starting at vertex 10')
self.assertEqual(spy[0][0].what(), 'line 1 contains 2 duplicate nodes starting at vertex 10')

self.assertEqual(spy[1][0].where(), QgsPointXY(1, 3))
self.assertEqual(spy[1][0].what(), 'line 1 contains 3 duplicate node(s) starting at vertex 5')
self.assertEqual(spy[1][0].what(), 'line 1 contains 3 duplicate nodes starting at vertex 5')

self.assertEqual(spy[2][0].where(), QgsPointXY(1, 1))
self.assertEqual(spy[2][0].what(), 'line 1 contains 3 duplicate node(s) starting at vertex 1')
self.assertEqual(spy[2][0].what(), 'line 1 contains 3 duplicate nodes starting at vertex 1')


if __name__ == '__main__':

0 comments on commit cf67076

Please sign in to comment.
You can’t perform that action at this time.