generic: adjust expected tests data

QUrl::StripTrailingSlash removes all trailing slashes and KUrl does not
convert to percentage encoding - local file URLs remain the same when
passed around.

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-06-24 20:54:23 +03:00
parent 0a5fadde75
commit 67d6fa8588
2 changed files with 5 additions and 5 deletions

View file

@ -141,12 +141,12 @@ void KUrlTest::testUrl_data()
QTest::newRow("ftp url") QTest::newRow("ftp url")
<< KUrl("ftp://ftp.kde.org/") << KUrl("ftp://ftp.kde.org/")
<< QString::fromLatin1("ftp://ftp.kde.org/") << QString::fromLatin1("ftp://ftp.kde.org/")
<< QString::fromLatin1("ftp://ftp.kde.org/") << QString::fromLatin1("ftp://ftp.kde.org")
<< QString::fromLatin1("ftp://ftp.kde.org/"); << QString::fromLatin1("ftp://ftp.kde.org/");
QTest::newRow("ftp url - 3 trailing slashes") QTest::newRow("ftp url - 3 trailing slashes")
<< KUrl("ftp://ftp.kde.org///") << KUrl("ftp://ftp.kde.org///")
<< QString::fromLatin1("ftp://ftp.kde.org///") << QString::fromLatin1("ftp://ftp.kde.org///")
<< QString::fromLatin1("ftp://ftp.kde.org/") << QString::fromLatin1("ftp://ftp.kde.org")
<< QString::fromLatin1("ftp://ftp.kde.org///"); << QString::fromLatin1("ftp://ftp.kde.org///");
} }
@ -189,8 +189,8 @@ void KUrlTest::testToStringList()
<< QLatin1String("file:///") << QLatin1String("file:///")
<< QLatin1String("file:///home/kde") << QLatin1String("file:///home/kde")
<< QLatin1String("file:///home/kde") << QLatin1String("file:///home/kde")
<< QLatin1String("ftp://ftp.kde.org/") << QLatin1String("ftp://ftp.kde.org")
<< QLatin1String("ftp://ftp.kde.org/") << QLatin1String("ftp://ftp.kde.org")
); );
//kDebug() << urls.toStringList(KUrl::AddTrailingSlash); //kDebug() << urls.toStringList(KUrl::AddTrailingSlash);

View file

@ -141,7 +141,7 @@ void KUrlCompletionTest::testLocalURL()
kDebug() << "Looking for" << m_dirURL.prettyUrl() + "file1"; kDebug() << "Looking for" << m_dirURL.prettyUrl() + "file1";
QVERIFY( comp1all.contains( m_dirURL.prettyUrl() + "file1" ) ); QVERIFY( comp1all.contains( m_dirURL.prettyUrl() + "file1" ) );
QVERIFY( comp1all.contains( m_dirURL.prettyUrl() + "file_subdir/" ) ); QVERIFY( comp1all.contains( m_dirURL.prettyUrl() + "file_subdir/" ) );
QString filehash = m_dirURL.prettyUrl() + "file%23a"; QString filehash = m_dirURL.prettyUrl() + "file#a";
QVERIFY( comp1all.contains( filehash ) ); QVERIFY( comp1all.contains( filehash ) );
QString filehashPath = m_completion->replacedPath( filehash ); // note that it returns a path!! QString filehashPath = m_completion->replacedPath( filehash ); // note that it returns a path!!
kDebug() << filehashPath; kDebug() << filehashPath;