Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Sep 18, 2023
1 parent c890433 commit 70d606e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/src/core/testqgsdatasourceuri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class TestQgsDataSourceUri: public QObject
void checkConnectionInfo_data();
void checkAuthParams();
void checkParameterKeys();
void checkRemovePassword();
};

void TestQgsDataSourceUri::checkparser_data()
Expand Down Expand Up @@ -524,5 +525,11 @@ void TestQgsDataSourceUri::checkParameterKeys()
QVERIFY( uri.parameterKeys().contains( QLatin1String( "bar" ) ) );
}

void TestQgsDataSourceUri::checkRemovePassword()
{
const QString uri = QgsDataSourceUri::removePassword( QStringLiteral( "postgresql://user:[email protected]:5432?dbname=test" ) );
QCOMPARE( uri, QStringLiteral( "postgresql://[email protected]:5432?dbname=test") );
}

QGSTEST_MAIN( TestQgsDataSourceUri )
#include "testqgsdatasourceuri.moc"

0 comments on commit 70d606e

Please sign in to comment.