Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a locale-specific goto test
  • Loading branch information
nirvn committed Jul 29, 2020
1 parent f77c1ea commit c4722b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/src/app/testqgsapplocatorfilters.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit c4722b4

Please sign in to comment.