Skip to content
Permalink
Browse files

Add a locale-specific goto test

  • Loading branch information
nirvn committed Jul 29, 2020
1 parent f77c1ea commit c4722b4f6b3fe11de7a18d23e5d217a97b6dbba1
Showing with 7 additions and 1 deletion.
  1. +7 −1 tests/src/app/testqgsapplocatorfilters.cpp
@@ -277,14 +277,20 @@ void TestQgsAppLocatorFilters::testGoto()
{
QgsGotoLocatorFilter filter;

// goto X,Y
// simple goto
QList< QgsLocatorResult > results = gatherResults( &filter, QStringLiteral( "4 5" ), QgsLocatorContext() );
QCOMPARE( results.count(), 2 );
QCOMPARE( results.at( 0 ).displayString, QObject::tr( "Go to 4 5 (Map CRS, )" ) );
QCOMPARE( results.at( 0 ).userData.toMap()[QStringLiteral( "point" )].value<QgsPointXY>(), QgsPointXY( 4, 5 ) );
QCOMPARE( results.at( 1 ).displayString, QObject::tr( "Go to 4° 5° (EPSG:4326 - WGS 84)" ) );
QCOMPARE( results.at( 1 ).userData.toMap()[QStringLiteral( "point" )].value<QgsPointXY>(), QgsPointXY( 4, 5 ) );

// locale-specific goto
results = gatherResults( &filter, QStringLiteral( "1,234.56 789.012" ), QgsLocatorContext() );
QCOMPARE( results.count(), 1 );
QCOMPARE( results.at( 0 ).displayString, QObject::tr( "Go to 1,234.56 789.012 (Map CRS, )" ) );
QCOMPARE( results.at( 0 ).userData.toMap()[QStringLiteral( "point" )].value<QgsPointXY>(), QgsPointXY( 1234.56, 789.012 ) );

// OSM/Leaflet/OpenLayers
results = gatherResults( &filter, QStringLiteral( "https://www.openstreetmap.org/#map=15/44.5546/6.4936" ), QgsLocatorContext() );
QCOMPARE( results.count(), 1 );

0 comments on commit c4722b4

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