#!/bin/bash

function error {
	echo
	more diff.txt
	echo
	pwd
	echo "TEST FAILED -- compare test_output to tmp.txt"
	echo
	exit 1
}

function check_okay {
	if [ $? -ne 0 ]
	then
		echo
		pwd
		echo "FAILED"
		echo
		exit 1
	fi
}

./mk
check_okay
./ck >& diff.txt
if [ $? -eq 0 ]
then
	if [ -s diff.txt ]
	then
		error
	fi
else
	error
fi
