aboutsummaryrefslogtreecommitdiff
path: root/test.sh
blob: 66ffe889323177201fac706331f4bb5db16f71db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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."