forked from qt-creator/qt-creator
CommandLine: Add a constructor test
Change-Id: I5d5bf8e7f31017f16663103f560e598e2a003d50 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -125,6 +125,31 @@ private slots:
|
|||||||
QCOMPARE(actual, expected);
|
QCOMPARE(actual, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testConstructor_data()
|
||||||
|
{
|
||||||
|
QTest::addColumn<CommandLine>("command");
|
||||||
|
QTest::addColumn<FilePath>("executable");
|
||||||
|
QTest::addColumn<QStringList>("arguments");
|
||||||
|
|
||||||
|
const FilePath filePath("some_path");
|
||||||
|
const QString arg("-arg");
|
||||||
|
const QStringList args{"-a", "-b", "-c"};
|
||||||
|
|
||||||
|
QTest::newRow("mixed-strings") << CommandLine{filePath, {"-A", arg, args}}
|
||||||
|
<< filePath << (QStringList{"-A"} << arg << args);
|
||||||
|
}
|
||||||
|
|
||||||
|
void testConstructor()
|
||||||
|
{
|
||||||
|
QFETCH(CommandLine, command);
|
||||||
|
QFETCH(FilePath, executable);
|
||||||
|
QFETCH(QStringList, arguments);
|
||||||
|
|
||||||
|
QCOMPARE(command.executable(), executable);
|
||||||
|
QCOMPARE(command.arguments(), arguments.join(' '));
|
||||||
|
QCOMPARE(command.splitArguments(), arguments);
|
||||||
|
}
|
||||||
|
|
||||||
void testFromUserInput_data()
|
void testFromUserInput_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<QString>("input");
|
QTest::addColumn<QString>("input");
|
||||||
|
Reference in New Issue
Block a user