1{
2 runCommand,
3 languageMachines,
4}:
5
6runCommand "frog-test" { } ''
7 ${languageMachines.frog}/bin/frog >$out <<EOF
8 Dit is een test
9
10 EOF
11 echo "Frog output:"
12 cat $out
13
14 expected () {
15 echo "Test expectation failed: $@"
16 exit 1
17 }
18
19 lines="$(wc -l $out | awk '{print $1}')"
20 test 5 = $lines || expected "Five lines of output"
21 grep "is" $out | grep "zijn" >/dev/null || expected "Stemming works"
22 grep "een" $out | grep "onbep" >/dev/null || expected "Tagging works"
23
24 deps="$(echo $(awk 'BEGIN { FS = "\t*" } ; {print $1 " -> " $9 "; "}' <$out))"
25 test "1 -> 2; 2 -> 0; 3 -> 4; 4 -> 2; -> ;" = "$deps" || expected "Dependency parsing works"
26''