From ec12d641faaab2758bc2a31f1c106bc8bdf84466 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 4 Nov 2013 17:40:01 +0100 Subject: tst_qurl: add test for matches() with empty vs null case Change-Id: I0f31eed9af0a7f1aed9ce5118b49ddbbff4f5f39 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 2128d68485..12b9159bf2 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -378,6 +378,14 @@ void tst_QUrl::comparison() QVERIFY(!passUrl1.matches(passUrl2, QUrl::None)); QVERIFY(passUrl1.matches(passUrl2, QUrl::RemovePassword)); + // RemovePassword, null vs empty + QUrl emptyPassUrl1("http://user:@host/"); + QUrl emptyPassUrl2("http://user@host/"); + QVERIFY(!(emptyPassUrl1 == emptyPassUrl2)); + QVERIFY(emptyPassUrl1 != emptyPassUrl2); + QVERIFY(!emptyPassUrl1.matches(emptyPassUrl2, QUrl::None)); + QVERIFY(emptyPassUrl1.matches(emptyPassUrl2, QUrl::RemovePassword)); + // RemoveQuery, RemoveFragment QUrl queryFragUrl1("http://host/file?query#fragment"); QUrl queryFragUrl2("http://host/file?q2#f2"); -- cgit v1.2.3