From 0cef93b4e2e9bf39b0ca542876f9ab1af6d0f01d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 May 2017 13:24:31 +0200 Subject: Implement support for tokenization of preprocessed C/C++ source --- unit-tests/cc/lexer/comment.test | 88 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 unit-tests/cc/lexer/comment.test (limited to 'unit-tests/cc/lexer/comment.test') diff --git a/unit-tests/cc/lexer/comment.test b/unit-tests/cc/lexer/comment.test new file mode 100644 index 0000000..e90d8e0 --- /dev/null +++ b/unit-tests/cc/lexer/comment.test @@ -0,0 +1,88 @@ +# file : unit-tests/cc/lexer/comment.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Test C and C++ comments. +# + +: c-comment +: +$* <"';'" +// /* +; +// */ +EOI + +: c-unterminated +: +$* <>EOE != 0 +/* +comment +EOI +stdin:1:2: error: unterminated comment +EOE + +: cxx-unterminated +: +$* <<:EOI +// comment +EOI + +: in-char-literal +: +$* <>EOO +'//' +'/*'*/ +EOI + + + + +EOO + +: in-string-literal +: +$* <>EOO +"//foo" +"/*"*/ +EOI + + + + +EOO + +: in-raw-string-literal +: +$* <>EOO +R"X( +// foo +/* bar +)X"*/ +EOI + + + +EOO -- cgit v1.1