summaryrefslogtreecommitdiffstats
path: root/tests/auto/qurl
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-09-03 09:51:50 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-09-03 09:54:29 (GMT)
commit884f15e533eea8426e71af8ac61e7233357b103c (patch)
tree5f4dbd7ed864aa17b717d8cf7d89d80b8e1750f8 /tests/auto/qurl
parent82ff6626eaabbaed83f3cdfc429a2d011701ba03 (diff)
downloadQt-884f15e533eea8426e71af8ac61e7233357b103c.zip
Qt-884f15e533eea8426e71af8ac61e7233357b103c.tar.gz
Qt-884f15e533eea8426e71af8ac61e7233357b103c.tar.bz2
Accept empty authority segments in QUrl as different from not-present
See the task for discussion on why this is necessary and why it is correct from the point of view of the RFC defining URIs. Task-number: QTBUG-8701 Patch-by: Marja Hassinen Signed-Off-By: Thiago Macieira
Diffstat (limited to 'tests/auto/qurl')
-rw-r--r--tests/auto/qurl/tst_qurl.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index 820e32d..370bd13 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -194,6 +194,7 @@ private slots:
void task_199967();
void task_240612();
void taskQTBUG_6962();
+ void taskQTBUG_8701();
#ifdef QT3_SUPPORT
void dirPath();
@@ -3912,5 +3913,17 @@ void tst_QUrl::taskQTBUG_6962()
QCOMPARE(url.authority(), QString());
}
+void tst_QUrl::taskQTBUG_8701()
+{
+ //bug 8701: foo:///bar mangled to foo:/bar
+ QString foo_triple_bar("foo:///bar"), foo_uni_bar("foo:/bar");
+
+ QCOMPARE(foo_triple_bar, QUrl(foo_triple_bar).toString());
+ QCOMPARE(foo_uni_bar, QUrl(foo_uni_bar).toString());
+
+ QCOMPARE(foo_triple_bar, QUrl(foo_triple_bar, QUrl::StrictMode).toString()); // fails
+ QCOMPARE(foo_uni_bar, QUrl(foo_uni_bar, QUrl::StrictMode).toString());
+}
+
QTEST_MAIN(tst_QUrl)
#include "tst_qurl.moc"