Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (16 sloc) 387 Bytes
#!/bin/bash
success=0
failed=0
function test
{
if [ "$1" == "$2" ]; then
let success=$success+1
echo "Ok $3"
else
let failed=$failed+1
echo "Failed $3" >&2
echo -e " Result: '$1'"
echo -e " Expected: '$2'"
fi
}
trap 'let all=$success+$failed;echo;echo "Tests run: $all";echo "Ok: $success";echo "Failed: $failed"; if [ 0 -lt "$failed" ]; then exit 1; fi' EXIT
Something went wrong with that request. Please try again.