diff options
Diffstat (limited to 'unit-tests/lexer/comment.test')
-rw-r--r-- | unit-tests/lexer/comment.test | 112 |
1 files changed, 112 insertions, 0 deletions
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. + +$* <<EOI >>:EOO # single-only +# comment +EOI +EOO + +$* <<EOI >>EOO # single-first +# comment +foo +EOI +'foo' +<newline> +EOO + +$* <<EOI >>EOO # single-last +foo +# comment +EOI +'foo' +<newline> +EOO + +$* <<EOI >>EOO # single-few +foo +# comment +# comment +EOI +'foo' +<newline> +EOO + +$* <<EOI >>EOO # single-cont +foo +# comment\\ +bar +EOI +'foo' +<newline> +'bar' +<newline> +EOO + +$* <<EOI >>EOO # single-same +foo # comment +bar # comment +EOI +'foo' +<newline> +'bar' +<newline> +EOO + +# Multi-line comments. +# + +$* <<EOI >>:EOO # multi-only +#\\ +comment +comment +#\\ +EOI +EOO + +$* <<EOI >>:EOO # multi-empty +#\\ +#\\ +EOI +EOO + +$* <<EOI >>EOO # multi-start-same +foo #\\ +comment +comment +#\\ +EOI +'foo' +<newline> +EOO + +$* <<EOI >>EOO # multi-end-same +#\\ +comment +comment +foo #\\ +bar +EOI +'bar' +<newline> +EOO + +$* <<EOI >>EOO # multi-end-not +#\\ +comment +#\\ not an end +foo #\\ +bar +EOI +'bar' +<newline> +EOO + +$* <<EOI 2>>EOE != 0 # multi-unterm +#\\ +comment +EOI +stdin:3:1: error: unterminated multi-line comment +EOE |