summaryrefslogtreecommitdiffstats
path: root/test
blob: dd8e802908ff93ccaf3e55b9b5cf3792afe853d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/sh

# 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