gsgp/test/common

34 lines
332 B
Plaintext
Raw Normal View History

#!/bin/bash
lastgiven=''
lastexpected=''
last()
{
lastgiven="$1"
lastexpected="$2"
}
assert-equal()
{
last "$1" "$2"
[ "$1" == "$2" ]
}
assert-eq()
{
last "$1" "$2"
[ $1 -eq $2 ]
}
fail()
{
echo "FAILURE: $1" >&2
echo "Expected '$lastexpected', but received '$lastgiven'" >&2
echo >&2
}