C++: Add basic tests for raw string literals

Change-Id: I9ca253a6a2296912eafe139ce53f4f9779097248
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Nikolai Kosjar
2015-09-21 10:12:39 +02:00
parent 7ba22d38d1
commit 8eb30feb03
3 changed files with 23 additions and 0 deletions

View File

@@ -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()