locationsrunnertest: Make test for executable file in home folder optional

GIT_SILENT
wilder-5.22
Alexander Lohnau 5 years ago
parent 99c11bbddc
commit 794ff7ce95
No known key found for this signature in database
GPG Key ID: 6C45BA731AA2ED36
  1. 10
      runners/locations/autotests/locationsrunnertest.cpp

@ -52,7 +52,6 @@ void ConverterRunnerTest::initTestCase()
}
}
QVERIFY(!normalHomeFile.isEmpty());
QVERIFY(!executableHomeFile.isEmpty());
}
void ConverterRunnerTest::shouldNotProduceResult()
@ -78,7 +77,9 @@ void ConverterRunnerTest::shouldNotProduceResult_data()
QTest::newRow("executable name") << "ls";
QTest::newRow("executable file path") << "/bin/ls";
QTest::newRow("executable file in home dir") << executableHomeFile;
if (!executableHomeFile.isEmpty()) {
QTest::newRow("executable file in home dir") << executableHomeFile;
}
QTest::newRow("executable path and argument") << "/bin/ls -Al";
QTest::newRow("non existent file") << QDir::homePath() + "_thisfiledoesnotexist.abc";
QTest::newRow("non existent file URL") << QUrl::fromLocalFile(QDir::homePath() + "_thisfiledoesnotexist.abc").toString();
@ -100,8 +101,9 @@ void ConverterRunnerTest::shouldProduceResult_data()
QTest::newRow("file tilde") << KShell::tildeCollapse(normalHomeFile) << QVariant(QUrl::fromLocalFile(normalHomeFile));
QTest::newRow("file with $HOME as env variable") << KShell::tildeCollapse(normalHomeFile).replace("~", "$HOME") << QVariant(QUrl::fromLocalFile(normalHomeFile));
QTest::newRow("file URL") << QUrl::fromLocalFile(normalHomeFile).toString() << QVariant(QUrl::fromLocalFile(normalHomeFile));
QTest::newRow("file URL to executable") << QUrl::fromLocalFile(executableHomeFile).toString() << QVariant(QUrl::fromLocalFile(executableHomeFile));
if (!executableHomeFile.isEmpty()) {
QTest::newRow("file URL to executable") << QUrl::fromLocalFile(executableHomeFile).toString() << QVariant(QUrl::fromLocalFile(executableHomeFile));
}
if (KProtocolInfo::isHelperProtocol("vnc")) {
QTest::newRow("vnc URL") << "vnc:foo" << QVariant("vnc:foo");
}

Loading…
Cancel
Save