diff options
author | David Faure <faure+bluesystems@kde.org> | 2012-12-21 16:38:19 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-14 20:44:54 (GMT) |
commit | 2e97dd401a09e4a9027dea885db7fd95e961a0c5 (patch) | |
tree | acff6664b12894ba1ec941347c73bb9d9ede4c75 /tests/auto/qurl | |
parent | 1e1486b9cf49e1bb26f44cde7f7a6667614585b0 (diff) | |
download | Qt-2e97dd401a09e4a9027dea885db7fd95e961a0c5.zip Qt-2e97dd401a09e4a9027dea885db7fd95e961a0c5.tar.gz Qt-2e97dd401a09e4a9027dea885db7fd95e961a0c5.tar.bz2 |
QUrl::fromUserInput: fix for urls without a host.
QUrl::fromUserInput("http://") was invalid, which doesn't make sense
since QUrl("http://") is valid. Same for "smb:" which is actually
even more a valid URL from a user's point of view.
Change-Id: I371ac393d61b49499edf5adbbc2a90b426fe9e5d
(cherry-picked from qt5 commit 8b2728ec382565c5bd57148600e34740a3c3fe52)
Reviewed-by: David Faure (KDE) <faure@kde.org>
Diffstat (limited to 'tests/auto/qurl')
-rw-r--r-- | tests/auto/qurl/tst_qurl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index 737f0e9..64c579c 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -3908,6 +3908,10 @@ void tst_QUrl::fromUserInput_data() QTest::newRow("add scheme-2") << "ftp.example.org" << QUrl("ftp://ftp.example.org"); QTest::newRow("add scheme-3") << "hostname" << QUrl("http://hostname"); + // no host + QTest::newRow("nohost-1") << "http://" << QUrl("http://"); + QTest::newRow("nohost-2") << "smb:" << QUrl("smb:"); + // QUrl's tolerant parser should already handle this QTest::newRow("not-encoded-0") << "http://example.org/test page.html" << QUrl::fromEncoded("http://example.org/test%20page.html"); |