blob: d3654136e5c96fffb125269043159504720f4439 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
set -e
# Check boundary conditions with small files. Output should match input.
for f in empty a ab abc abcd; do
./markov <tests/$f > out
if !(diff tests/$f out > /dev/null); then
echo tests/$f: output of markov does not match input:
diff tests/$f out
exit 1
fi
done
rm out
# Check that all words, pairs, and triples in output are in original.
orig=tests/psalms
./markov <$orig > out
awk -f tests/match.awk $orig out
rm out
# Check that the output has a similar ratio of c's and d's to test randomness of
# suffix selection.
./markov <tests/stats | freq -c | awk -f tests/stats.awk
echo ok
|