sanskrit-iast/tests/integration.sh

30 lines
946 B
Bash
Raw Normal View History

2020-01-13 20:11:59 +01:00
#!/bin/sh
set -e
usage=$(./iast -h)
test -n $(echo "$usage" | grep "iast [flags and text arguments in any order]")
version=$(./iast -v)
test "$version" = "iast v2.0.0"
2020-01-13 20:11:59 +01:00
./iast -f tests/texts/bhagavadgita-1.txt |
./iast -r -f - >/tmp/iast-bhagavadgita-1.txt.out
./iast -f tests/texts/mandukya-upanishad.txt |
./iast -r -f - >/tmp/iast-mandukya-upanishad.txt.out
./iast -f tests/texts/rg-01001.txt |
./iast -r -f - >/tmp/rg-01001.txt.out
2020-01-13 20:11:59 +01:00
expected=$(sha1sum tests/texts/bhagavadgita-1.txt | head -c40)
computed=$(sha1sum /tmp/iast-bhagavadgita-1.txt.out | head -c40)
test "$expected" = "$computed"
expected=$(sha1sum tests/texts/mandukya-upanishad.txt | head -c40)
computed=$(sha1sum /tmp/iast-mandukya-upanishad.txt.out | head -c40)
test "$expected" = "$computed"
expected=$(sha1sum tests/texts/rg-01001.txt | head -c40)
computed=$(sha1sum /tmp/rg-01001.txt.out | head -c40)
test "$expected" = "$computed"
printf "\033[32mpassed\033[0m\n"