new test program, part 1
[mala.git] / tests / 20basic.tests
blob3aa7de82ff9738fb2a6b0ade40ba6aa816a3b949
1 # arch-tag: org.pipapo.mala.tests.basic
3 TESTING "basic tests:" ./test-mala
5 TEST "no args" <<END
6 stdout: .
7 variable: (null)
8 state: MACRO
9 END
11 #TEST "pass" --PASS <<END
13 #state: MACRO
14 #END
17 TEST "print" foo --PRINT bar <<END
18 stdout: bar.
19 literal: foo.
20 variable: (null)
21 state: STATEMENT
22 END
25 TEST "subst" --SUBST-TEST <<END
26 stdout: .
27 literal: SUBST_SUCCEEDED.
28 variable: (null)
29 state: LITERAL
30 END
33 TEST "expand" --FOOBAR <<END
34 stdout: .
35 literal: foo.
36 literal: bar.
37 variable: (null)
38 state: LITERAL
39 END
42 TEST "cat" --CAT foo bar <<END
43 stdout: .
44 literal: foobar.
45 variable: (null)
46 state: LITERAL
47 END
50 TEST "--LITERAL" --LITERAL --LITERAL foobar <<END
51 stdout: .
52 literal: --LITERAL.
53 literal: foobar.
54 variable: (null)
55 state: LITERAL
56 END
59 TEST "--SKIP" --SKIP 1 --PRINT foo --PRINT bar --PRINT baz <<END
60 stdout: barbaz.
61 literal: --PRINT.
62 literal: foo.
63 variable: (null)
64 state: STATEMENT
65 END
68 TEST "--SKIP 0" --SKIP 0 --PRINT foo --PRINT bar --PRINT baz <<END
69 stdout: foobarbaz.
70 variable: (null)
71 state: STATEMENT
72 END
75 TEST "--SKIP -1" --SKIP -1 --PRINT foo --PRINT bar --PRINT baz <<END
76 stdout: .
77 literal: --ERROR-OUT-OF-RANGE.
78 literal: --SKIP.
79 literal: -1.
80 literal: --PRINT.
81 literal: foo.
82 literal: --PRINT.
83 literal: bar.
84 literal: --PRINT.
85 literal: baz.
86 variable: (null)
87 state: ENOACTION
88 END
91 TEST "--SKIP 2" --SKIP 2 --PRINT foo --PRINT bar --PRINT baz <<END
92 stdout: barbaz.
93 literal: --PRINT.
94 literal: foo.
95 variable: (null)
96 state: STATEMENT
97 END
100 TEST "--SKIP 2 none" --SKIP 2 --PRINT foo <<END
101 stdout: .
102 literal: --PRINT.
103 literal: foo.
104 variable: (null)
105 state: STATEMENT
109 TEST "--SKIP 2 missing" --SKIP 2 --PRINT <<END
110 stdout: .
111 literal: --ERROR-MISSING-ARGUMENT.
112 literal: --SKIP.
113 literal: 2.
114 literal: --PRINT.
115 variable: (null)
116 state: ENOACTION