test suite improvements
[mala.git] / tests / 30expansion.tests
blobd6ed83a7fc252f6ceefc641c0018b9d4ce867238
1 # arch-tag: org.pipapo.mala.tests.expansion
3 TESTING "plain engine/ppexpansion tests:" ./test-mala_expansions
5 TEST "no args" <<END
6 prg: --NULL
7 variable: (null)
8 negated: 0
9 state: 0
10 END
12 TEST "one longopt" --foo <<END
13 prg: --foo
14 variable: (null)
15 negated: 0
16 state: 0
17 END
19 TEST "one shortopt" -f <<END
20 prg: -f
21 variable: (null)
22 negated: 0
23 state: 0
24 END
26 TEST "2 args" foo bar <<END
27 prg: foo
28 prg: bar
29 variable: (null)
30 negated: 0
31 state: 0
32 END
35 TEST "simple exclam_expansion" ! --foo <<END
36 prg: --NOT
37 prg: --foo
38 variable: (null)
39 negated: 0
40 state: 0
41 END
43 TEST "simple no_expansion" --no-foo <<END
44 prg: --NOT
45 prg: --foo
46 variable: (null)
47 negated: 0
48 state: 0
49 END
51 TEST "simple char_expansion" -foo+bar <<END
52 prg: -f
53 prg: -o
54 prg: -o
55 prg: +b
56 prg: +a
57 prg: +r
58 variable: (null)
59 negated: 0
60 state: 0
61 END
63 TEST "simple assign_expansion" --foo=bar <<END
64 prg: --foo
65 prg: bar
66 variable: (null)
67 negated: 0
68 state: 0
69 END
72 TEST "simple setenv_expansion" variable=foobar <<END
73 prg: --SETENV
74 prg: variable
75 prg: foobar
76 variable: (null)
77 negated: 0
78 state: 0
79 END
82 export FOO=BAR
83 TEST "simple envvar_expansion" --\$FOO <<END
84 prg: --ENVSUBST
85 prg: --\$FOO
86 variable: (null)
87 negated: 0
88 state: 0
89 END
91 TEST "simple underscore_expansion" --foo_bar <<END
92 prg: --foo-bar
93 variable: (null)
94 negated: 0
95 state: 0
96 END
98 TEST "simple numsplit_expansion" -f00 <<END
99 prg: -f
100 prg: 00
101 variable: (null)
102 negated: 0
103 state: 0
106 TEST "simple bracket_expansion" [foobar] <<END
107 prg: --SECTION
108 prg: foobar
109 variable: (null)
110 negated: 0
111 state: 0
114 TEST "simple assign_contraction" variable = foobar <<END
115 prg: --SETENV
116 prg: variable
117 prg: foobar
118 variable: (null)
119 negated: 0
120 state: 0
123 TEST "complex" variable = foobar --no-\$variable <<END
124 prg: --SETENV
125 prg: variable
126 prg: foobar
127 prg: --NOT
128 prg: --ENVSUBST
129 prg: --\$variable
130 variable: (null)
131 negated: 0
132 state: 0
135 TEST "complex envvar_expansion 1" --no-\${FOO} <<END
136 prg: --NOT
137 prg: --ENVSUBST
138 prg: --\${FOO}
139 variable: (null)
140 negated: 0
141 state: 0
144 TEST "complex longopt assign_expansion with spaces" --foo="bar baz" <<END
145 prg: --foo
146 prg: bar baz
147 variable: (null)
148 negated: 0
149 state: 0
152 TEST "shortopt with number" -foo0bar <<END
153 prg: -f
154 prg: -o
155 prg: -o
156 prg: 0bar
157 variable: (null)
158 negated: 0
159 state: 0