From c55240fb05151cae046c75a793c164d72c988db2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 6 Jan 2017 18:46:58 +0300 Subject: Tests cleanup (take 2) --- unit-tests/lexer/comment.test | 221 ++++++++++++++++++++++++------------------ 1 file changed, 124 insertions(+), 97 deletions(-) (limited to 'unit-tests/lexer/comment.test') diff --git a/unit-tests/lexer/comment.test b/unit-tests/lexer/comment.test index 025b0a2..6840219 100644 --- a/unit-tests/lexer/comment.test +++ b/unit-tests/lexer/comment.test @@ -2,111 +2,138 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -# Single-line comments. +: single-line +: +{ + : only + : + $* <>:EOO + # comment + EOI + EOO -$* <>:EOO # single-only -# comment -EOI -EOO + : first + : + $* <>EOO + # comment + foo + EOI + 'foo' + + EOO -$* <>EOO # single-first -# comment -foo -EOI -'foo' - -EOO + : last + : + $* <>EOO + foo + # comment + EOI + 'foo' + + EOO -$* <>EOO # single-last -foo -# comment -EOI -'foo' - -EOO + : few + : + $* <>EOO + foo + # comment + # comment + EOI + 'foo' + + EOO -$* <>EOO # single-few -foo -# comment -# comment -EOI -'foo' - -EOO + : cont + : + $* <>EOO + foo + # comment\\ + bar + EOI + 'foo' + + 'bar' + + EOO -$* <>EOO # single-cont -foo -# comment\\ -bar -EOI -'foo' - -'bar' - -EOO + : same + : + $* <>EOO + foo # comment + bar # comment + EOI + 'foo' + + 'bar' + + EOO +} -$* <>EOO # single-same -foo # comment -bar # comment -EOI -'foo' - -'bar' - -EOO +: multi-line +: +{ + : only + : + $* <>:EOO + #\ + comment + comment + #\ + EOI + EOO -# Multi-line comments. -# + : empty + : + $* <>:EOO + #\ + #\ + EOI + EOO -$* <>:EOO # multi-only -#\ -comment -comment -#\ -EOI -EOO + : start-same + : + $* <>EOO + foo #\ + comment + comment + #\ + EOI + 'foo' + + EOO -$* <>:EOO # multi-empty -#\ -#\ -EOI -EOO + : end-same + : + $* <>EOO + #\ + comment + comment + foo #\ + bar + EOI + 'bar' + + EOO -$* <>EOO # multi-start-same -foo #\ -comment -comment -#\ -EOI -'foo' - -EOO + : end-not + : + $* <>EOO + #\ + comment + #\ not an end + foo #\ + bar + EOI + 'bar' + + 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 + : unterm + : + $* <>EOE != 0 + #\ + comment + EOI + stdin:3:1: error: unterminated multi-line comment + EOE +} -- cgit v1.1