From e565e1425d6d1f51b9f596e06d46ec97fa53110b Mon Sep 17 00:00:00 2001 From: xonix Date: Mon, 18 Sep 2023 00:10:04 +0300 Subject: [PATCH] Revamp `@define` #140 : changing `@define` --- tests/16_define_validation.sh | 57 ++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/tests/16_define_validation.sh b/tests/16_define_validation.sh index 177a323..037d589 100644 --- a/tests/16_define_validation.sh +++ b/tests/16_define_validation.sh @@ -1,38 +1,39 @@ -@define EMPTY= -@define EMPTY1='' -@define EMPTY2=$'' -@define EMPTY3="" -@define _a123=123 -@define good__NaMe_=123 -@define A=aaa -@define B='bbb bbb' -@define B1='bbb # bbb' -@define B2='bbb ; bbb' -@define C=$'cc\'c cc\'c' -@define C1='cc'\''c cc'\''c' -@define D=a\ b\ \ c -@define D1=a\b\c\d -@define D2=a\'\c\" -@define E="eee eee" -@define F="eee \\ \" eee" +@define EMPTY '' +@define EMPTY1 '' +@define EMPTY2 $'' +@define EMPTY3 "" +@define _a123 123 +@define good__NaMe_ 123 +@define A aaa +@define B 'bbb bbb' +@define B1 'bbb # bbb' +@define B2 'bbb ; bbb' +@define C $'cc\'c cc\'c' +@define C1 "$C" +@define D $'a b c' +@define D1 abcd +@define D2 $'a\'c"' +@define E "eee eee" +@define F "eee \\ \" eee" -@define K=aaa'bbb'$'cc\'c'a\ b\ \ c"eee" -@define L="$A$B $C$D $E" +@define K $'aaabbbcc\'ca b ceee' +@define L "$A$B $C$D $E" -@define AC1=aaa # comment -@define AC2=aaa# # comment -@define BC1='bbb bbb' # comment -@define BC2='bbb bbb'# # comment -@define CC1=$'cc\'c cc\'c' # -@define DC1=a\ b\ c # -@define EC1="eee" # comment +@define AC1 aaa # comment +@define AC2 'aaa#' # comment +@define BC1 'bbb bbb' # comment +@define BC2 'bbb bbb#' # comment +@define CC1 $'cc\'c cc\'c' # +@define DC1 'a b c' # +@define EC1 "eee" # comment -@define KC1=aaa'bbb'$'cc\'c'a\ b\ c"eee" # some comment -@define LC1="$A$B$C$D$E" # other comment +@define KC1 $'aaabbbcc\'ca b ceee' # some comment +@define LC1 "$A$B$C$D$E" # other comment @goal default for x in EMPTY EMPTY1 EMPTY2 EMPTY3 _a123 good__NaMe_ A B B1 B2 C C1 D D1 D2 E F K L AC1 AC2 BC1 BC2 CC1 DC1 EC1 KC1 LC1 +# for x in EMPTY1 EMPTY2 EMPTY3 _a123 good__NaMe_ A B B1 B2 C C1 D D1 D2 E F K L AC1 AC2 BC1 BC2 CC1 DC1 EC1 KC1 LC1 do printf '%-3s=%s\n' "$x" "${!x}" done