From: Matthew Vernon Date: Sun, 22 Aug 2021 11:21:49 +0000 (+0100) Subject: Add a test suite for use with autopkgtest X-Git-Tag: archive/debian/4.36~1 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~matthewv/git?a=commitdiff_plain;h=e722dd01299ba4d03a1b409a8bceddda55ba7bc0;p=bible-kjv.git Add a test suite for use with autopkgtest This should make sure the package is working properly in future... --- diff --git a/debian/tests/bible-tests.sh b/debian/tests/bible-tests.sh new file mode 100755 index 0000000..ecab3a3 --- /dev/null +++ b/debian/tests/bible-tests.sh @@ -0,0 +1,16 @@ +#!/bin/bash -ex + +#Simple lookup - only 1 matching verse +bible -f '??girl' | grep 'Jl3:3' + +#Simple lookup - 1840 matches, 2 header lines +diff -u <( bible -f '??hath' | wc -l ) <(echo 1842) + +#Check text of a verse is correct +bible -f Jn11:35 | grep -F "John11:35 Jesus wept." + +#Check search combination (cumbersome on the CLI) +diff -u <( bible -f ??beginning "?a end" "?a year" | tail -1 ) <( echo "Dt11:12" ) + +#Check output matches entire rawtext file (less header line) +diff -u <( bible -f 'gen1:1-rev99:99' ) <( tail -n +2 bible.rawtext ) diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..6c05e81 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,3 @@ +#Autopkg tests for the Bible package +Tests: bible-tests.sh +Restrictions: allow-stderr