2011-10-26 08:21:16 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
EXIT_CODE=0
|
|
|
|
|
|
|
|
run_test()
|
|
|
|
{
|
|
|
|
echo -n " $1"
|
2011-11-11 13:22:26 +00:00
|
|
|
cat "$2" | ./ex19 >/dev/null
|
|
|
|
if [[ "$?" -eq "0" ]]
|
2011-10-26 08:21:16 +00:00
|
|
|
then
|
|
|
|
echo " ... OK"
|
|
|
|
else
|
|
|
|
echo " ... FAIL"
|
|
|
|
EXIT_CODE=1
|
|
|
|
fi
|
2011-11-11 13:22:26 +00:00
|
|
|
rm -f "$2"
|
2011-10-26 08:21:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-11-11 13:22:26 +00:00
|
|
|
tmp_01="`mktemp`"
|
|
|
|
cat > "$tmp_01" <<EOF
|
2011-10-26 08:21:16 +00:00
|
|
|
l
|
|
|
|
n
|
|
|
|
w
|
|
|
|
n
|
|
|
|
w
|
|
|
|
n
|
|
|
|
w
|
|
|
|
e
|
|
|
|
w
|
|
|
|
e
|
|
|
|
e
|
|
|
|
e
|
|
|
|
s
|
|
|
|
s
|
|
|
|
w
|
|
|
|
w
|
|
|
|
n
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
EOF
|
|
|
|
|
2011-11-11 13:22:26 +00:00
|
|
|
tmp_02="`mktemp`"
|
|
|
|
cat > "$tmp_02" <<EOF
|
2011-10-26 08:21:16 +00:00
|
|
|
l
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
n
|
|
|
|
hutesoahutesohas
|
|
|
|
999999999999
|
|
|
|
l
|
|
|
|
n
|
|
|
|
n
|
|
|
|
n
|
|
|
|
e
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
2011-11-11 13:22:26 +00:00
|
|
|
run_test '01' "$tmp_01"
|
|
|
|
run_test '02' "$tmp_02"
|
2011-10-26 08:21:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
exit $EXIT_CODE
|