1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
assert::equals () { local -r result="$1"; shift local -r expected="$1"; shift if [ "$result" != "$expected" ]; then cat <<ERROR Expected '$expected' But got '$result' ERROR exit 2 fi echo "Assert OK: $expected" }