From 28f8338ded34f160e0083da9be4679bc778be7ca Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 Nov 2016 11:18:34 +0200 Subject: Distinguish token quoting type and completeness --- unit-tests/lexer/comment.test | 112 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 unit-tests/lexer/comment.test (limited to 'unit-tests/lexer/comment.test') diff --git a/unit-tests/lexer/comment.test b/unit-tests/lexer/comment.test new file mode 100644 index 0000000..07d7ac5 --- /dev/null +++ b/unit-tests/lexer/comment.test @@ -0,0 +1,112 @@ +# file : unit-tests/lexer/comment.test +# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Single-line comments. + +$* <>:EOO # single-only +# comment +EOI +EOO + +$* <>EOO # single-first +# comment +foo +EOI +'foo' + +EOO + +$* <>EOO # single-last +foo +# comment +EOI +'foo' + +EOO + +$* <>EOO # single-few +foo +# comment +# comment +EOI +'foo' + +EOO + +$* <>EOO # single-cont +foo +# comment\\ +bar +EOI +'foo' + +'bar' + +EOO + +$* <>EOO # single-same +foo # comment +bar # comment +EOI +'foo' + +'bar' + +EOO + +# Multi-line comments. +# + +$* <>:EOO # multi-only +#\\ +comment +comment +#\\ +EOI +EOO + +$* <>:EOO # multi-empty +#\\ +#\\ +EOI +EOO + +$* <>EOO # multi-start-same +foo #\\ +comment +comment +#\\ +EOI +'foo' + +EOO + +$* <>EOO # multi-end-same +#\\ +comment +comment +foo #\\ +bar +EOI +'bar' + +EOO + +$* <>EOO # multi-end-not +#\\ +comment +#\\ not an end +foo #\\ +bar +EOI +'bar' + +EOO + +$* <>EOE != 0 # multi-unterm +#\\ +comment +EOI +stdin:3:1: error: unterminated multi-line comment +EOE -- cgit v1.1