diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qmlformat/data/verbatimString.formatted.qml | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmlformat/data/verbatimString.qml | 4 | ||||
-rw-r--r-- | tests/auto/qml/qmlformat/tst_qmlformat.cpp | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlformat/data/verbatimString.formatted.qml b/tests/auto/qml/qmlformat/data/verbatimString.formatted.qml new file mode 100644 index 0000000000..fa7fbbe32b --- /dev/null +++ b/tests/auto/qml/qmlformat/data/verbatimString.formatted.qml @@ -0,0 +1,4 @@ +Item { + property string verbatim1: 'A "verbatim" string!' + property string verbatim2: "A 'verbatim' string\u2757" +} diff --git a/tests/auto/qml/qmlformat/data/verbatimString.qml b/tests/auto/qml/qmlformat/data/verbatimString.qml new file mode 100644 index 0000000000..15b080a87b --- /dev/null +++ b/tests/auto/qml/qmlformat/data/verbatimString.qml @@ -0,0 +1,4 @@ +Item { +property string verbatim1: 'A "verbatim" string!' +property string verbatim2: "A 'verbatim' string\u2757" +}
\ No newline at end of file diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp index 5a8974b907..ba34f0f923 100644 --- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp +++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp @@ -51,6 +51,7 @@ private Q_SLOTS: void testIfBlocks(); void testReadOnlyProps(); + void testVerbatimStrings(); #if !defined(QTEST_CROSS_COMPILED) // sources not available when cross compiled void testExample(); @@ -217,6 +218,12 @@ void TestQmlformat::testReadOnlyProps() QCOMPARE(runQmlformat(testFile("readOnlyProps.qml"), false, true), readTestFile("readOnlyProps.formatted.qml")); } +void TestQmlformat::testVerbatimStrings() +{ + QCOMPARE(runQmlformat(testFile("verbatimString.qml"), false, true), + readTestFile("verbatimString.formatted.qml")); +} + void TestQmlformat::testLineEndings() { // macos |