From 5007870b52aa549971824959a55ad3bb886f09e0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Sep 2018 16:37:32 +0200 Subject: Rename .test/test{} to .testscript/testscript{} --- unit-tests/cc/lexer/raw-string-literal.testscript | 90 +++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 unit-tests/cc/lexer/raw-string-literal.testscript (limited to 'unit-tests/cc/lexer/raw-string-literal.testscript') diff --git a/unit-tests/cc/lexer/raw-string-literal.testscript b/unit-tests/cc/lexer/raw-string-literal.testscript new file mode 100644 index 0000000..df475ef --- /dev/null +++ b/unit-tests/cc/lexer/raw-string-literal.testscript @@ -0,0 +1,90 @@ +# file : unit-tests/cc/lexer/raw-string-literal.testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Test raw string literals. +# + +: normal +: +$* <>EOO +R"()" +R"(ab)" +R"(a"b)" +R"(a)b)" +R"%(a%)b)%" +R"X(a + b)X" +R"X(a\ + b)X" +EOI + + + + + + + +EOO + +: prefix +: +$* <>EOO +LR"(ab)" +UR"(ab)" +uR"(ab)" +u8R"(ab)" +EOI + + + + +EOO + +: suffix +: +$* <>EOO +R"(ab)"x +R"(ab)"_X123 +EOI + + +EOO + +: escape +: +$* <>EOO +R"(\)" +EOI + +EOO + +: invalid-no-paren +: +$* <'R"a"' 2>>EOE != 0 +stdin:1:2: error: invalid raw string literal +EOE + +: invalid-paren +: +$* <'R")()("' 2>>EOE != 0 +stdin:1:2: error: invalid raw string literal +EOE + +: invalid-unterminated-paren +: +$* <'R"(abc"' 2>>EOE != 0 +stdin:1:2: error: invalid raw string literal +EOE + +: invalid-unterminated-delimiter +: +$* <'R"X(abc)"' 2>>EOE != 0 +stdin:1:2: error: invalid raw string literal +EOE + +: invalid-unterminated-quote +: +$* <'R"X(abc)X' 2>>EOE != 0 +stdin:1:2: error: invalid raw string literal +EOE -- cgit v1.1