aboutsummaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..cc6a14b
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+SUCCESS=true
+while IFS=$'\t' read -r req res; do
+ outcome="$(./pf -nt "$req" | grep Result | cut -d' ' -f3-)"
+ if [ "$res" != "$outcome" ]; then
+ echo "Test failed: $req"
+ echo "Expected result: $res"
+ echo "Actual result: $outcome"
+ SUCCESS=false
+ fi
+done < "test.tsv"
+
+$SUCCESS && echo "All tests passed."