stringlist_string_set to replace the string of a stringlist node
[mala.git] / tests / 40preprocessor.tests
blob5e5bb1fca39436065dfeb13698afcff0d9cd9591
2 TESTING "preprocessor tests:" ./test-mala
4 TEST "one longopt" --PREPROCESS --foo <<END
5 stdout: .
6 literal: --foo.
7 variable: (null)
8 state: STATEMENT
9 END
11 TEST "one shortopt" --PREPROCESS -f <<END
12 stdout: .
13 literal: -f.
14 variable: (null)
15 state: STATEMENT
16 END
19 TEST "2 args" --PREPROCESS foo bar <<END
20 stdout: .
21 literal: foo.
22 literal: bar.
23 variable: (null)
24 state: STATEMENT
25 END
28 TEST "backquote expansion" --PREPROCESS \`--foo <<END
29 stdout: .
30 literal: --LITERAL.
31 literal: --foo.
32 variable: (null)
33 state: STATEMENT
34 END
37 TEST "simple numsplit_expansion" --PREPROCESS -f00 <<END
38 stdout: .
39 literal: -f.
40 literal: 00.
41 variable: (null)
42 state: STATEMENT
43 END
46 TEST "simple exclam_expansion" --PREPROCESS ! --foo <<END
47 stdout: .
48 literal: --NO.
49 literal: --foo.
50 variable: (null)
51 state: STATEMENT
52 END
55 TEST "double exclam_expansion" --PREPROCESS ! --foo ! ! --bar <<END
56 stdout: .
57 literal: --NO.
58 literal: --foo.
59 literal: --NO.
60 literal: --NO.
61 literal: --bar.
62 variable: (null)
63 state: STATEMENT
64 END
68 TEST "simple no_expansion" --PREPROCESS --no-foo <<END
69 stdout: .
70 literal: --NOT
71 literal: --foo
72 variable: (null)
73 state: STATEMENT
74 END
76 TEST "simple char_expansion" --PREPROCESS -foo+bar <<END
77 stdout: .
78 literal: -f
79 literal: -o
80 literal: -o
81 literal: +b
82 literal: +a
83 literal: +r
84 variable: (null)
85 state: STATEMENT
86 END
88 TEST "simple assign_expansion" --PREPROCESS --foo=bar <<END
89 stdout: .
90 literal: --foo
91 literal: bar
92 variable: (null)
93 state: STATEMENT
94 END
97 TEST "simple setenv_expansion" --PREPROCESS variable=foobar <<END
98 stdout: .
99 literal: --SETENV
100 literal: variable
101 literal: foobar
102 variable: (null)
103 state: STATEMENT
107 export FOO=BAR
108 TEST "simple envvar_expansion" --PREPROCESS --\$FOO <<END
109 stdout: .
110 literal: --ENVSUBST
111 literal: --\$FOO
112 variable: (null)
113 state: STATEMENT
116 TEST "simple underscore_expansion" --PREPROCESS --foo_bar <<END
117 stdout: .
118 literal: --foo-bar
119 variable: (null)
120 state: STATEMENT
124 TEST "simple bracket_expansion" --PREPROCESS [foobar] <<END
125 stdout: .
126 literal: --SECTION
127 literal: foobar
128 variable: (null)
129 state: STATEMENT
132 TEST "simple assign_contraction" --PREPROCESS variable = foobar <<END
133 stdout: .
134 literal: --SETENV
135 literal: variable
136 literal: foobar
137 variable: (null)
138 state: STATEMENT
141 TEST "complex" --PREPROCESS variable = foobar --no-\$variable <<END
142 stdout: .
143 literal: --SETENV
144 literal: variable
145 literal: foobar
146 literal: --NOT
147 literal: --ENVSUBST
148 literal: --\$variable
149 variable: (null)
150 state: STATEMENT
153 TEST "complex envvar_expansion 1" --PREPROCESS --no-\${FOO} <<END
154 stdout: .
155 literal: --NOT
156 literal: --ENVSUBST
157 literal: --\${FOO}
158 variable: (null)
159 state: STATEMENT
162 TEST "complex longopt assign_expansion with spaces" --PREPROCESS --foo="bar baz" <<END
163 stdout: .
164 literal: --foo
165 literal: bar baz
166 variable: (null)
167 state: STATEMENT
170 TEST "shortopt with number" --PREPROCESS -foo0bar <<END
171 stdout: .
172 literal: -f
173 literal: -o
174 literal: -o
175 literal: 0bar
176 variable: (null)
177 state: STATEMENT