#!/bin/sh

run() {
	prog=$1
	desired=$2
	out=`./build/resp $prog`
	if [ "$out" != "$desired" ]; then
		echo "FAIL: $prog";
		echo "    Expected: \"$desired\"";
		echo "    Output:   \"$out\"";
	else
		echo "PASS: $prog"
	fi
}

run './test/ack.resp'      '8189 : Int'
run './test/closure.resp'  '6 : Int'
run './test/def.resp'      '4 : Int'
run './test/deffn.resp'    '3 : Int'
run './test/fac.resp'      '720 : Int'
run './test/inlinefn.resp' '2 : Int'
run './test/nest.resp'     '8 : Int'
run './test/tup.resp'      '5 : Int'
run './test/string.resp'   '"Hello, world!" : String'
run './test/let.resp'      '5 : Int'
run './test/match.resp'    '"Hello, rectangle!" : String'

#run './test/poly.resp' '#t : Bool'