summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBrett Stottlemyer <bstottle@ford.com>2018-06-22 19:46:45 -0400
committerBrett Stottlemyer <bstottle@ford.com>2018-06-26 11:02:47 +0000
commitb03f330a91bf3a76cb8aed6ebc921ebb1910350e (patch)
treeca33c9a28c9cc1211b1b29b26fa52123fc863e7f /tests
parent79e3325887ffdbc012a288729e93601314c8a3b3 (diff)
Improve support for comments in .rep files
Add support for "standalone" comments in the file or class definition. Task-number: QTBUG-68976 Change-Id: Ie59af56daf76bba84292aa6a095a5e105861a41e Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/repparser/tst_parser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/repparser/tst_parser.cpp b/tests/auto/repparser/tst_parser.cpp
index 1e22ebb..b749a15 100644
--- a/tests/auto/repparser/tst_parser.cpp
+++ b/tests/auto/repparser/tst_parser.cpp
@@ -70,6 +70,9 @@ void tst_Parser::testBasic_data()
QTest::newRow("preprocessor_line_ifgroup") << "#if 1\n#include \"foo\n#endif";
//QTest::newRow("comment") << "//This is a comment";
QTest::newRow("enum") << "ENUM MyEnum {test}";
+ QTest::newRow("empty class with comment") << "class MyClass {\n//comment\n}";
+ QTest::newRow("comment, class") << "//comment\nclass MyClass {}";
+ QTest::newRow("include, comment, class") << "#include \"foo\"\n//comment\nclass MyClass {}";
}
void tst_Parser::testBasic()
@@ -96,6 +99,9 @@ void tst_Parser::testProperties_data()
QTest::addColumn<bool>("expectedPersistence");
QTest::newRow("default") << "PROP(QString foo)" << "QString" << "foo" << QString() << ASTProperty::ReadPush << false;
+ QTest::newRow("default with comment") << "PROP(QString foo) // my property" << "QString" << "foo" << QString() << ASTProperty::ReadPush << false;
+ QTest::newRow("default with comment above") << "// my property\nPROP(QString foo)" << "QString" << "foo" << QString() << ASTProperty::ReadPush << false;
+ QTest::newRow("default with indented comment above") << " // my property\nPROP(QString foo)" << "QString" << "foo" << QString() << ASTProperty::ReadPush << false;
QTest::newRow("readonly") << "PROP(QString foo READONLY)" << "QString" << "foo" << QString() << ASTProperty::ReadOnly << false;
QTest::newRow("constant") << "PROP(QString foo CONSTANT)" << "QString" << "foo" << QString() << ASTProperty::Constant << false;
QTest::newRow("readwrite") << "PROP(QString foo READWRITE)" << "QString" << "foo" << QString() << ASTProperty::ReadWrite << false;