Changeset View
Changeset View
Standalone View
Standalone View
src/autotests/BookMarkTest.cpp
| Show All 39 Lines | 37 | { | |||
|---|---|---|---|---|---|
| 40 | auto groupUrlList = bookmarkManager->root().groupUrlList(); | 40 | auto groupUrlList = bookmarkManager->root().groupUrlList(); | ||
| 41 | 41 | | |||
| 42 | // text explaining test, correct test result | 42 | // text explaining test, correct test result | ||
| 43 | QStringList bm_urls = { | 43 | QStringList bm_urls = { | ||
| 44 | QStringLiteral("simple command"), QStringLiteral("ssh machine"), | 44 | QStringLiteral("simple command"), QStringLiteral("ssh machine"), | ||
| 45 | QStringLiteral("command with pipe (|)"), QStringLiteral("ssh machine | tee -a /var/log/system.log"), | 45 | QStringLiteral("command with pipe (|)"), QStringLiteral("ssh machine | tee -a /var/log/system.log"), | ||
| 46 | QStringLiteral("file URL w/ non ASCII part"), QStringLiteral("file:///home/user/aκόσμε"), | 46 | QStringLiteral("file URL w/ non ASCII part"), QStringLiteral("file:///home/user/aκόσμε"), | ||
| 47 | QStringLiteral("command with double quotes"), QStringLiteral("isql-fb -u sysdba -p example \"test\""), | 47 | QStringLiteral("command with double quotes"), QStringLiteral("isql-fb -u sysdba -p example \"test\""), | ||
| 48 | QStringLiteral("command with single quotes"), QStringLiteral("isql-fb -u sysdba -p example 'test'") | 48 | QStringLiteral("command with single quotes"), QStringLiteral("isql-fb -u sysdba -p example 'test'"), | ||
| 49 | QStringLiteral("command with %"), QStringLiteral("date +%m-%d-%Y") | ||||
| 49 | }; | 50 | }; | ||
| 50 | 51 | | |||
| 51 | QTest::addColumn<QString>("text"); | 52 | QTest::addColumn<QString>("text"); | ||
| 52 | QTest::addColumn<QString>("result"); | 53 | QTest::addColumn<QString>("result"); | ||
| 53 | for (int i = 0; i < groupUrlList.size(); ++i) { | 54 | for (int i = 0; i < groupUrlList.size(); ++i) { | ||
| 54 | const auto& bm_url = groupUrlList.at(i); | 55 | const auto& bm_url = groupUrlList.at(i); | ||
| 55 | // Current Konsole code using bm.url() | 56 | // Verify this line matching SessionControll.cpp to validate tests | ||
| 56 | // The below is new to test decoding the url/command | 57 | auto bm = QUrl::fromPercentEncoding(bm_url.toEncoded()); | ||
| 57 | auto bm = QUrl::fromPercentEncoding(bm_url.url().toUtf8()); | | |||
| 58 | QTest::newRow(bm_urls.at(i * 2).toUtf8().data())<< bm_urls.at((i * 2) +1) << bm; | 58 | QTest::newRow(bm_urls.at(i * 2).toUtf8().data())<< bm_urls.at((i * 2) +1) << bm; | ||
| 59 | } | 59 | } | ||
| 60 | } | 60 | } | ||
| 61 | 61 | | |||
| 62 | // Only test top level URLs (no folders) | 62 | // Only test top level URLs (no folders) | ||
| 63 | void BookMarkTest::testBookMarkURLs() | 63 | void BookMarkTest::testBookMarkURLs() | ||
| 64 | { | 64 | { | ||
| 65 | QFETCH(QString, text); | 65 | QFETCH(QString, text); | ||
| Show All 18 Lines | |||||