Skip to content

Commit

Permalink
Better string
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 16, 2020
1 parent 41a30ac commit cf67076
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsgeometryvalidator.cpp
Expand Up @@ -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++;
Expand Down
6 changes: 3 additions & 3 deletions tests/src/python/test_qgsgeometryvalidator.py
Expand Up @@ -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__':
Expand Down

0 comments on commit cf67076

Please sign in to comment.