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/lexer/buildfile | 2 +- unit-tests/lexer/buildspec.test | 16 ---- unit-tests/lexer/buildspec.testscript | 16 ++++ unit-tests/lexer/comment.test | 139 ---------------------------------- unit-tests/lexer/comment.testscript | 139 ++++++++++++++++++++++++++++++++++ unit-tests/lexer/eval.test | 76 ------------------- unit-tests/lexer/eval.testscript | 76 +++++++++++++++++++ unit-tests/lexer/quoting.test | 108 -------------------------- unit-tests/lexer/quoting.testscript | 108 ++++++++++++++++++++++++++ 9 files changed, 340 insertions(+), 340 deletions(-) delete mode 100644 unit-tests/lexer/buildspec.test create mode 100644 unit-tests/lexer/buildspec.testscript delete mode 100644 unit-tests/lexer/comment.test create mode 100644 unit-tests/lexer/comment.testscript delete mode 100644 unit-tests/lexer/eval.test create mode 100644 unit-tests/lexer/eval.testscript delete mode 100644 unit-tests/lexer/quoting.test create mode 100644 unit-tests/lexer/quoting.testscript (limited to 'unit-tests/lexer') diff --git a/unit-tests/lexer/buildfile b/unit-tests/lexer/buildfile index 2e14979..7434018 100644 --- a/unit-tests/lexer/buildfile +++ b/unit-tests/lexer/buildfile @@ -3,4 +3,4 @@ # license : MIT; see accompanying LICENSE file include ../../build2/ -exe{driver}: {hxx cxx}{*} ../../build2/libu{b} test{*} +exe{driver}: {hxx cxx}{*} ../../build2/libu{b} testscript{*} diff --git a/unit-tests/lexer/buildspec.test b/unit-tests/lexer/buildspec.test deleted file mode 100644 index 9aa0f55..0000000 --- a/unit-tests/lexer/buildspec.test +++ /dev/null @@ -1,16 +0,0 @@ -# file : unit-tests/lexer/buildspec.test -# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -test.arguments = buildspec - -: punctuation -: -$* <:'x,x(x)' >>EOO -'x' -, -'x' - ( -'x' -) -EOO diff --git a/unit-tests/lexer/buildspec.testscript b/unit-tests/lexer/buildspec.testscript new file mode 100644 index 0000000..d3dd660 --- /dev/null +++ b/unit-tests/lexer/buildspec.testscript @@ -0,0 +1,16 @@ +# file : unit-tests/lexer/buildspec.testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +test.arguments = buildspec + +: punctuation +: +$* <:'x,x(x)' >>EOO +'x' +, +'x' + ( +'x' +) +EOO diff --git a/unit-tests/lexer/comment.test b/unit-tests/lexer/comment.test deleted file mode 100644 index 8e0ef2e..0000000 --- a/unit-tests/lexer/comment.test +++ /dev/null @@ -1,139 +0,0 @@ -# file : unit-tests/lexer/comment.test -# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -: single-line -: -{ - : only - : - $* <>:EOO - # comment - EOI - EOO - - : first - : - $* <>EOO - # comment - foo - EOI - 'foo' - - EOO - - : last - : - $* <>EOO - foo - # comment - EOI - 'foo' - - EOO - - : few - : - $* <>EOO - foo - # comment - # comment - EOI - 'foo' - - EOO - - : cont - : - $* <>EOO - foo - # comment\\ - bar - EOI - 'foo' - - 'bar' - - EOO - - : same - : - $* <>EOO - foo # comment - bar # comment - EOI - 'foo' - - 'bar' - - EOO -} - -: multi-line -: -{ - : only - : - $* <>:EOO - #\ - comment - comment - #\ - EOI - EOO - - : empty - : - $* <>:EOO - #\ - #\ - EOI - EOO - - : start-same - : - $* <>EOO - foo #\ - comment - comment - #\ - EOI - 'foo' - - EOO - - : end-same - : - $* <>EOO - #\ - comment - comment - foo #\ - bar - EOI - 'bar' - - EOO - - : end-not - : - $* <>EOO - #\ - comment - #\ not an end - foo #\ - bar - EOI - 'bar' - - EOO - - : unterm - : - $* <>EOE != 0 - #\ - comment - EOI - stdin:3:1: error: unterminated multi-line comment - EOE -} diff --git a/unit-tests/lexer/comment.testscript b/unit-tests/lexer/comment.testscript new file mode 100644 index 0000000..44aee11 --- /dev/null +++ b/unit-tests/lexer/comment.testscript @@ -0,0 +1,139 @@ +# file : unit-tests/lexer/comment.testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +: single-line +: +{ + : only + : + $* <>:EOO + # comment + EOI + EOO + + : first + : + $* <>EOO + # comment + foo + EOI + 'foo' + + EOO + + : last + : + $* <>EOO + foo + # comment + EOI + 'foo' + + EOO + + : few + : + $* <>EOO + foo + # comment + # comment + EOI + 'foo' + + EOO + + : cont + : + $* <>EOO + foo + # comment\\ + bar + EOI + 'foo' + + 'bar' + + EOO + + : same + : + $* <>EOO + foo # comment + bar # comment + EOI + 'foo' + + 'bar' + + EOO +} + +: multi-line +: +{ + : only + : + $* <>:EOO + #\ + comment + comment + #\ + EOI + EOO + + : empty + : + $* <>:EOO + #\ + #\ + EOI + EOO + + : start-same + : + $* <>EOO + foo #\ + comment + comment + #\ + EOI + 'foo' + + EOO + + : end-same + : + $* <>EOO + #\ + comment + comment + foo #\ + bar + EOI + 'bar' + + EOO + + : end-not + : + $* <>EOO + #\ + comment + #\ not an end + foo #\ + bar + EOI + 'bar' + + EOO + + : unterm + : + $* <>EOE != 0 + #\ + comment + EOI + stdin:3:1: error: unterminated multi-line comment + EOE +} diff --git a/unit-tests/lexer/eval.test b/unit-tests/lexer/eval.test deleted file mode 100644 index 4bd33c4..0000000 --- a/unit-tests/lexer/eval.test +++ /dev/null @@ -1,76 +0,0 @@ -# file : unit-tests/lexer/eval.test -# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -test.arguments = eval - -: punctuation -: -$* <:'x:x{x}x[x]x$x?x,x(x)' >>EOO -'x' -: -'x' -{ -'x' -} -'x' -[ -'x' -] -'x' -$ -'x' -? -'x' -, -'x' -( -'x' -) -EOO - -: logical -: -$* <:'x|x||x&x&&x!x!!x)' >>EOO -'x|x' -|| -'x&x' -&& -'x' -! -'x' -! -! -'x' -) -EOO - -: comparison -: -$* <:'x=x==x!=xx>=)' >>EOO -'x=x' -== -'x' -!= -'x' -< -'x' -<= -'x' -> -'x' ->= -) -EOO - -: newline -: -$* <'x' >- 2>>EOE != 0 -stdin:1:2: error: newline in evaluation context -EOE - -: eof -: -$* <:'' 2>>EOE != 0 -stdin:1:1: error: unterminated evaluation context -EOE diff --git a/unit-tests/lexer/eval.testscript b/unit-tests/lexer/eval.testscript new file mode 100644 index 0000000..f09eed4 --- /dev/null +++ b/unit-tests/lexer/eval.testscript @@ -0,0 +1,76 @@ +# file : unit-tests/lexer/eval.testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +test.arguments = eval + +: punctuation +: +$* <:'x:x{x}x[x]x$x?x,x(x)' >>EOO +'x' +: +'x' +{ +'x' +} +'x' +[ +'x' +] +'x' +$ +'x' +? +'x' +, +'x' +( +'x' +) +EOO + +: logical +: +$* <:'x|x||x&x&&x!x!!x)' >>EOO +'x|x' +|| +'x&x' +&& +'x' +! +'x' +! +! +'x' +) +EOO + +: comparison +: +$* <:'x=x==x!=xx>=)' >>EOO +'x=x' +== +'x' +!= +'x' +< +'x' +<= +'x' +> +'x' +>= +) +EOO + +: newline +: +$* <'x' >- 2>>EOE != 0 +stdin:1:2: error: newline in evaluation context +EOE + +: eof +: +$* <:'' 2>>EOE != 0 +stdin:1:1: error: unterminated evaluation context +EOE diff --git a/unit-tests/lexer/quoting.test b/unit-tests/lexer/quoting.test deleted file mode 100644 index 708e904..0000000 --- a/unit-tests/lexer/quoting.test +++ /dev/null @@ -1,108 +0,0 @@ -# file : unit-tests/lexer/quoting.test -# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -test.options += -q - -: unquoted -: -$* <'foo' >>EOO -'foo' - -EOO - -: comp -: -{ - : single - : - $* <":'foo':" >>EOO - : - 'foo' [S/C] - : - - EOO - - : double - : - $* <':"foo":' >>EOO - : - 'foo' [D/C] - : - - EOO - - : single-empty - : - $* <"''" >>EOO - '' [S/C] - - EOO - - : double-empty - : - $* <'""' >>EOO - '' [D/C] - - EOO -} - -: part -{ - : quoted - { - : start - : Token start already quoted - : - $* <'"$foo"' >>EOO - '' [D/P] - $ [D/C] - 'foo' [D/P] - - EOO - - : end - : Token end still quoted - : - $* <'"foo$"' >>EOO - 'foo' [D/P] - $ [D/C] - '' [D/P] - - EOO - } - - : unquoted - { - : start - : Token starts with unquoted character - : - $* <'f"oo"' >>EOO - 'foo' [D/P] - - EOO - - : end - : Token continous with unquoted character - : - $* <'"fo"o' >>EOO - 'foo' [D/P] - - EOO - - : escape - : Token continous with unquoted escaped character - : - $* <'"fo"\"' >>EOO - 'fo"' [D/P] - - EOO - } -} - -: mixed -: -$* <"\"fo\"'o'" >>EOO -'foo' [M/P] - -EOO diff --git a/unit-tests/lexer/quoting.testscript b/unit-tests/lexer/quoting.testscript new file mode 100644 index 0000000..8543a67 --- /dev/null +++ b/unit-tests/lexer/quoting.testscript @@ -0,0 +1,108 @@ +# file : unit-tests/lexer/quoting.testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +test.options += -q + +: unquoted +: +$* <'foo' >>EOO +'foo' + +EOO + +: comp +: +{ + : single + : + $* <":'foo':" >>EOO + : + 'foo' [S/C] + : + + EOO + + : double + : + $* <':"foo":' >>EOO + : + 'foo' [D/C] + : + + EOO + + : single-empty + : + $* <"''" >>EOO + '' [S/C] + + EOO + + : double-empty + : + $* <'""' >>EOO + '' [D/C] + + EOO +} + +: part +{ + : quoted + { + : start + : Token start already quoted + : + $* <'"$foo"' >>EOO + '' [D/P] + $ [D/C] + 'foo' [D/P] + + EOO + + : end + : Token end still quoted + : + $* <'"foo$"' >>EOO + 'foo' [D/P] + $ [D/C] + '' [D/P] + + EOO + } + + : unquoted + { + : start + : Token starts with unquoted character + : + $* <'f"oo"' >>EOO + 'foo' [D/P] + + EOO + + : end + : Token continous with unquoted character + : + $* <'"fo"o' >>EOO + 'foo' [D/P] + + EOO + + : escape + : Token continous with unquoted escaped character + : + $* <'"fo"\"' >>EOO + 'fo"' [D/P] + + EOO + } +} + +: mixed +: +$* <"\"fo\"'o'" >>EOO +'foo' [M/P] + +EOO -- cgit v1.1