From b0b048c03930b826ab3dbf88b56fd664fca26886 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 22 May 2020 15:32:31 +0300 Subject: Add script command redirect aliases --- .../script/lexer+command-expansion.test.testscript | 102 ++++++++++++++++++--- 1 file changed, 88 insertions(+), 14 deletions(-) (limited to 'libbuild2/script/lexer+command-expansion.test.testscript') diff --git a/libbuild2/script/lexer+command-expansion.test.testscript b/libbuild2/script/lexer+command-expansion.test.testscript index 9422cba..f4d69d2 100644 --- a/libbuild2/script/lexer+command-expansion.test.testscript +++ b/libbuild2/script/lexer+command-expansion.test.testscript @@ -113,17 +113,37 @@ test.arguments = command-expansion { : newline : - $* <:"0>EOO + $* <:"0<<<=a b" >>EOO '0' - < + <<<= 'a b' EOO : no-newline : - $* <:"0<:a b" >>EOO + $* <:"0<<<=:a b" >>EOO '0' - <: + <<<=: + 'a b' + EOO + } + + : in-alias + : + { + : newline + : + $* <:"0<<>EOO + '0' + <<< + 'a b' + EOO + + : no-newline + : + $* <:"0<<<:a b" >>EOO + '0' + <<<: 'a b' EOO } @@ -133,17 +153,17 @@ test.arguments = command-expansion { : newline : - $* <:"1>a b" >>EOO + $* <:"1>>>?a b" >>EOO '1' - > + >>>? 'a b' EOO : no-newline : - $* <:"1>:a b" >>EOO + $* <:"1>>>?:a b" >>EOO '1' - >: + >>>?: 'a b' EOO } @@ -157,6 +177,26 @@ test.arguments = command-expansion { : newline : + $* <:"0<<=E O I" >>EOO + '0' + <<= + 'E O I' + EOO + + : no-newline + : + $* <:"0<<=:E O I" >>EOO + '0' + <<=: + 'E O I' + EOO + } + + : in-alias + : + { + : newline + : $* <:"0<>EOO '0' << @@ -177,17 +217,17 @@ test.arguments = command-expansion { : newline : - $* <:"1>>E O O" >>EOO + $* <:"1>>?E O O" >>EOO '1' - >> + >>? 'E O O' EOO : no-newline : - $* <:"1>>:E O O" >>EOO + $* <:"1>>?:E O O" >>EOO '1' - >>: + >>?: 'E O O' EOO } @@ -198,9 +238,17 @@ test.arguments = command-expansion { : in : - $* <:"0<<>EOO + $* <:"0<=a b" >>EOO '0' - <<< + <= + 'a b' + EOO + + : in-alias + : + $* <:"0>EOO + '0' + < 'a b' EOO @@ -212,6 +260,14 @@ test.arguments = command-expansion 'a b' EOO + : out-alias + : + $* <:"1>a b" >>EOO + '1' + > + 'a b' + EOO + : out-app : $* <:"1>+a b" >>EOO @@ -219,8 +275,26 @@ test.arguments = command-expansion >+ 'a b' EOO + + : out-app-alias + : + $* <:"1>>a b" >>EOO + '1' + >> + 'a b' + EOO } +: no-out-alias +: +$* <:"1>>>a b" >>EOO +'1' +>> +> +'a b' +EOO + + : cleanup : { -- cgit v1.1