use --WORLD as root of all actions (GC just deletes --WORLD)
[mala.git] / tests / 30expansion.tests
blob95fc40b15755af201da2324795c74daed91c05d5
1 # arch-tag: org.pipapo.mala.tests.expansion
3 TESTING "plain engine/ppexpansion tests:" ./test-mala_expansions
5 TEST "one longopt" --foo <<END
6 prg: --foo
7 variable: (null)
8 negated: 0
9 state: CONTINUE
10 END
12 TEST "one shortopt" -f <<END
13 prg: -f
14 variable: (null)
15 negated: 0
16 state: CONTINUE
17 END
19 TEST "2 args" foo bar <<END
20 prg: foo
21 prg: bar
22 variable: (null)
23 negated: 0
24 state: CONTINUE
25 END
28 TEST "simple exclam_expansion" ! --foo <<END
29 prg: --NOT
30 prg: --foo
31 variable: (null)
32 negated: 0
33 state: CONTINUE
34 END
36 TEST "simple no_expansion" --no-foo <<END
37 prg: --NOT
38 prg: --foo
39 variable: (null)
40 negated: 0
41 state: CONTINUE
42 END
44 TEST "simple char_expansion" -foo+bar <<END
45 prg: -f
46 prg: -o
47 prg: -o
48 prg: +b
49 prg: +a
50 prg: +r
51 variable: (null)
52 negated: 0
53 state: CONTINUE
54 END
56 TEST "simple assign_expansion" --foo=bar <<END
57 prg: --foo
58 prg: bar
59 variable: (null)
60 negated: 0
61 state: CONTINUE
62 END
65 TEST "simple setenv_expansion" variable=foobar <<END
66 prg: --SETENV
67 prg: variable
68 prg: foobar
69 variable: (null)
70 negated: 0
71 state: CONTINUE
72 END
75 export FOO=BAR
76 TEST "simple envvar_expansion" --\$FOO <<END
77 prg: --ENVSUBST
78 prg: --\$FOO
79 variable: (null)
80 negated: 0
81 state: CONTINUE
82 END
84 TEST "simple underscore_expansion" --foo_bar <<END
85 prg: --foo-bar
86 variable: (null)
87 negated: 0
88 state: CONTINUE
89 END
91 TEST "simple numsplit_expansion" -f00 <<END
92 prg: -f
93 prg: 00
94 variable: (null)
95 negated: 0
96 state: CONTINUE
97 END
99 TEST "simple bracket_expansion" [foobar] <<END
100 prg: --SECTION
101 prg: foobar
102 variable: (null)
103 negated: 0
104 state: CONTINUE
107 TEST "simple assign_contraction" variable = foobar <<END
108 prg: --SETENV
109 prg: variable
110 prg: foobar
111 variable: (null)
112 negated: 0
113 state: CONTINUE
116 TEST "complex" variable = foobar --no-\$variable <<END
117 prg: --SETENV
118 prg: variable
119 prg: foobar
120 prg: --NOT
121 prg: --ENVSUBST
122 prg: --\$variable
123 variable: (null)
124 negated: 0
125 state: CONTINUE
128 TEST "complex envvar_expansion 1" --no-\${FOO} <<END
129 prg: --NOT
130 prg: --ENVSUBST
131 prg: --\${FOO}
132 variable: (null)
133 negated: 0
134 state: CONTINUE
137 TEST "complex longopt assign_expansion with spaces" --foo="bar baz" <<END
138 prg: --foo
139 prg: bar baz
140 variable: (null)
141 negated: 0
142 state: CONTINUE
145 TEST "shortopt with number" -foo0bar <<END
146 prg: -f
147 prg: -o
148 prg: -o
149 prg: 0bar
150 variable: (null)
151 negated: 0
152 state: CONTINUE