From 57b10c06925d0bdf6ffb38488ee908f085109e95 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 4 Jul 2019 19:12:15 +0300 Subject: Move config, dist, test, and install modules into library --- .../test/script/lexer+command-line.test.testscript | 208 +++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 libbuild2/test/script/lexer+command-line.test.testscript (limited to 'libbuild2/test/script/lexer+command-line.test.testscript') diff --git a/libbuild2/test/script/lexer+command-line.test.testscript b/libbuild2/test/script/lexer+command-line.test.testscript new file mode 100644 index 0000000..eedb46f --- /dev/null +++ b/libbuild2/test/script/lexer+command-line.test.testscript @@ -0,0 +1,208 @@ +# file : libbuild2/test/script/lexer+command-line.test.testscript +# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +test.arguments = command-line + +: semi +{ + : immediate + : + $* <"cmd;" >>EOO + 'cmd' + ; + + EOO + + : separated + : + $* <"cmd ;" >>EOO + 'cmd' + ; + + EOO + + : only + : + $* <";" >>EOO + ; + + EOO +} + +: colon +: +{ + : immediate + : + $* <"cmd: dsc" >>EOO + 'cmd' + : + 'dsc' + + EOO + + : separated + : + $* <"cmd :dsc" >>EOO + 'cmd' + : + 'dsc' + + EOO + + : only + : + $* <":" >>EOO + : + + EOO +} + +: redirect +: +{ + : pass + : + $* <"cmd <| 1>|" >>EOO + 'cmd' + <| + '1' + >| + + EOO + + : null + : + $* <"cmd <- 1>-" >>EOO + 'cmd' + <- + '1' + >- + + EOO + + : trace + : + $* <"cmd 1>!" >>EOO + 'cmd' + '1' + >! + + EOO + + : merge + : + $* <"cmd 1>&2" >>EOO + 'cmd' + '1' + >& + '2' + + EOO + + : str + : + $* <"cmd b" >>EOO + 'cmd' + < + 'a' + '1' + > + 'b' + + EOO + + : str-nn + : + $* <"cmd <:a 1>:b" >>EOO + 'cmd' + <: + 'a' + '1' + >: + 'b' + + EOO + + : doc + : + $* <"cmd <>EOO" >>EOO + 'cmd' + << + 'EOI' + '1' + >> + 'EOO' + + EOO + + : doc-nn + : + $* <"cmd <<:EOI 1>>:EOO" >>EOO + 'cmd' + <<: + 'EOI' + '1' + >>: + 'EOO' + + EOO + + : file-cmp + : + $* <"cmd <<>>out 2>>>err" >>EOO + 'cmd' + <<< + 'in' + >>> + 'out' + '2' + >>> + 'err' + + EOO + + : file-write + : + $* <"cmd >=out 2>+err" >>EOO + 'cmd' + >= + 'out' + '2' + >+ + 'err' + + EOO +} + +: cleanup +: +{ + : always + : + $* <"cmd &file" >>EOO + 'cmd' + & + 'file' + + EOO + + : maybe + : + $* <"cmd &?file" >>EOO + 'cmd' + &? + 'file' + + EOO + + : never + : + $* <"cmd &!file" >>EOO + 'cmd' + &! + 'file' + + EOO +} -- cgit v1.1