diff options
author | David Faure <faure+bluesystems@kde.org> | 2012-12-21 17:38:19 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-23 10:50:28 +0100 |
commit | 8b2728ec382565c5bd57148600e34740a3c3fe52 (patch) | |
tree | c6d436e03b53d533f669073f47083f067071d589 /tests | |
parent | 69627730eaf3a024186e2f2dad1842aa32d9ccb8 (diff) |
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
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/io/qurl/tst_qurl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index a45efce0db..ec402dd986 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -2617,6 +2617,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"); |