Git init
[external/mawk.git] / test / mawktest.v7
1 : 'This is a simple test that a new made mawk seems to'
2 : 'be working OK.'
3 : 'It is certainly not exhaustive, but the last two tests in'
4 : 'particular use most features.'
5 :
6
7 dat=mawktest.dat
8
9 trap 'echo mawk_test failed ; rm -f temp$$ ; exit 1'  0
10
11 : 'find out which mawk we are testing'
12 ./mawk -Wv
13
14
15 echo testing input and field splitting
16 ./mawk -f wc.awk $dat | cmp -s - wc-awk.out || exit
17
18 echo input and field splitting OK
19
20 echo
21 echo testing regular expression matching
22 ./mawk -f reg0.awk $dat > temp$$
23 ./mawk -f reg1.awk $dat >> temp$$
24 ./mawk -f reg2.awk $dat >> temp$$
25
26 cmp -s reg-awk.out temp$$ || exit
27 echo regular expression matching OK
28
29 echo
30 echo testing arrays and flow of control
31 ./mawk -f wfrq0.awk $dat | cmp -s - wfrq-awk.out || exit
32
33 echo array test OK
34
35 echo
36 echo testing function calls and general stress test
37 ./mawk -f ../examples/decl.awk $dat | cmp -s - decl-awk.out || exit
38
39 echo general stress test passed
40
41 echo
42 echo  tested mawk seems OK
43
44 trap 0
45 rm -f temp$$
46 exit 0