1 # arch-tag: org.pipapo.mala.tests.stdmodule
3 TESTING "stdmodule tests:" ./test-mala_stdmodule
11 TEST "--LITERAL" --LITERAL --LITERAL foobar <<END
19 PLANNED "negated --LITERAL" ! --LITERAL <<END
22 prg: --HERE-ERROR-NEGATED
28 TEST "missing arg at --PRINT" --PRINT <<END
29 prg: --ERROR-MISSING-ARGUMENT
37 PLANNED "--no-PRINT" --no-PRINT <<END
38 prg: --ERROR-UNEXPECTED-NEGATED
46 TEST "--PRINT --LITERAL" --PRINT --LITERAL --LITERAL --NL <<END
53 TEST "--PRINT and --NL" --PRINT "foo bar" --NL <<END
60 PLANNED "negated --DEF" ! --DEF foo bar --END-DEF <<END
63 prg: --HERE-ERROR-NEGATED
72 TEST "missing name at --DEF" --DEF <<END
73 prg: --ERROR-MISSING-ARGUMENT
81 TEST "missing body at --DEF" --DEF foo <<END
82 prg: --ERROR-MISSING-ARGUMENT
91 TEST "define macro w/o parameter" --DEF foo --BEGIN bar baz --END <<END
97 TEST "substitute" --DEF foo bar foo <<END
104 TEST "expand macro w/o parameter" --DEF foo --BEGIN bar baz --END foo <<END
112 TEST "define macro w/ parameter" --DEF foo --BEGIN %1 bar --END <<END
118 TEST "expand macro w/ parameter" --DEF foo --BEGIN %1 bar --END foo baz <<END
126 PLANNED "%% expand test" --DEF foo foo%%bar foo baz <<END
134 PLANNED "%0 expand test" --DEF foo foo%0bar --END-DEF foo baz <<END
142 PLANNED "%PREV expand test" --DEF foo bar barf --END-DEF --DEF foo baz %PREV --END-DEF foo gnarf <<END
152 PLANNED "%END expand test" --DEF --foo bar %END--END-foo barf --END-DEF --foo bat baz --END-foo gnarf <<END
163 PLANNED "%END escape test" --DEF foo 1 %ENDendfoo 2 --END-DEF 3 foo 4 --ESCAPE endfoo 5 endfoo 6 <<END
176 TEST "define nested macro w/o parameter" --DEF foo --BEGIN bar --DEF baz --BEGIN barf gnarf --END --END baz foo baz <<END
186 PLANNED "variable expansion in macro" variable = bar --DEF foo '$variable' --END-DEF --PRINT foo --NL <<END
193 TEST "missing macro argument" --DEF foo %2 foo bar <<END
194 prg: --ERROR-MISSING-ARGUMENT
203 PLANNED "stale --END" --PRINT foo --NL --END <<END
205 prg: --ERROR-END-WITHOUT-BEGIN
213 PLANNED "escaped argument" --DEF foo %%1 foo <<END
220 TEST "invalid macro" --DEF foo %illegal foo bar <<END
221 prg: --ERROR-PARAMETER-SYNTAX
233 PLANNED "definition redefinition" --DEF --substitute --ESCAPE --DEF %1 %2 --ESCAPE --END-DEF --END-DEF --substitute foo bar foo <<END
240 TEST "printl" --PRINTL --LITERAL foo <<END
247 PLANNED "undef substitution" --DEF foo bar foo --UNDEF foo foo <<END
255 PLANNED "undef error" --UNDEF foo <<END
256 prg: --ERROR-UNKNOWN-ACTION
265 PLANNED "undef expand" --DEF foo --BEGIN bar baz --END foo --UNDEF foo foo <<END
274 PLANNED "undef macro" --DEF foo --BEGIN bar %1 --END foo baz --UNDEF foo foo baz <<END
284 PLANNED "redef macro" --DEF foo bar --REDEF foo baz foo goo --UNDEF foo --UNDEF foo <<END
287 prg: --ERROR-UNKNOWN-ACTION
290 prg: --HERE-ERROR-UNKNOWN-ACTION
296 PLANNED "defined" --DEFINED --DEF ! --DEFINED foo --DEFINED bar --NO-DEFINED --DEFINED <<END
306 PLANNED "attach" --DEF foo bar --END-DEF --DEF baz barf --END-DEF --ATTACH foo baz foo --UNDEF baz foo <<END
314 PLANNED "detach" --DEF foo bar --END-DEF --DEF baz barf --END-DEF --ATTACH foo baz foo --DETACH foo --UNDEF baz foo <<END
322 PLANNED "if" --IF --TRUE success --END-IF --IF --FALSE fail --END-IF bar <<END
330 PLANNED "elif true" --TEST --FALSE --ELIF --TRUE success --END-ELIF bar <<END
338 PLANNED "elif false" --TEST --FALSE --ELIF --FALSE success --END-ELIF <<END
344 PLANNED "elif not entered" --TEST --TRUE --ELIF --TRUE success --END-ELIF <<END
350 PLANNED "else passed" --TEST --TRUE --ELSE success --END-ELSE bar <<END
357 PLANNED "else entered" --TEST --FALSE --ELSE success --END-ELSE <<END