diff --git a/tests/auto/cplusplus/cxx11/data/rawstringliterals.cpp b/tests/auto/cplusplus/cxx11/data/rawstringliterals.cpp new file mode 100644 index 00000000000..d77f4275def --- /dev/null +++ b/tests/auto/cplusplus/cxx11/data/rawstringliterals.cpp @@ -0,0 +1,11 @@ +class String; +void f() +{ + String r1 = R"(raw text)"; + String r2 = R"( +raw text line1 +raw text line2 +)"; + String other; +} + diff --git a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp index cf8b540f23d..0298fb02362 100644 --- a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp +++ b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp @@ -198,6 +198,7 @@ void tst_cxx11::parse_data() QTest::newRow("trailingtypespec.1") << "trailingtypespec.1.cpp" << ""; QTest::newRow("lambda.2") << "lambda.2.cpp" << ""; QTest::newRow("userDefinedLiterals.1") << "userDefinedLiterals.1.cpp" << ""; + QTest::newRow("rawstringliterals") << "rawstringliterals.cpp" << ""; } void tst_cxx11::parse() diff --git a/tests/auto/cplusplus/lexer/tst_lexer.cpp b/tests/auto/cplusplus/lexer/tst_lexer.cpp index 5622c8097e0..fc2b8da0476 100644 --- a/tests/auto/cplusplus/lexer/tst_lexer.cpp +++ b/tests/auto/cplusplus/lexer/tst_lexer.cpp @@ -335,6 +335,17 @@ void tst_SimpleLexer::literals_data() << T_NUMERIC_LITERAL << T_ERROR << T_ERROR << T_ERROR ; QTest::newRow("integer-literals") << source << expectedTokenKindList; + + source = + "R\"(raw text)\"\n" + "R\"delimiter(raw text)delimiter\"\n" + "R\"delimiter(\nraw text line1\nraw text line2\n)delimiter\"\n" + ; + expectedTokenKindList = + TokenKindList() << T_RAW_STRING_LITERAL << T_RAW_STRING_LITERAL + << T_RAW_STRING_LITERAL + ; + QTest::newRow("raw-string-literals") << source << expectedTokenKindList; } void tst_SimpleLexer::preprocessor()