815d3683f7
when LUA_PATH contains `;;`, it is replaced by `;LUA_PATH_DEFAULT;` in lua 5.1: Updated https://github.com/lua/lua/blob/69ea087dff1daba25a2000dfb8f1883c17545b7a/loadlib.c#L599 More recent versions might be smarter ? https://github.com/lua/lua/blob/65b07dd53d7938a60112fc4473f5cad3473e3534/loadlib.c#L301
22 lines
442 B
Bash
22 lines
442 B
Bash
# Always failing assertion with a message.
|
|
#
|
|
# Example:
|
|
# fail "It should have been but it wasn't to be"
|
|
function fail() {
|
|
echo -e "$1"
|
|
exit 1
|
|
}
|
|
|
|
|
|
function assertStringEqual() {
|
|
if ! diff <(echo "$1") <(echo "$2") ; then
|
|
fail "Actual value: \"$1\"\nExpected value: \"$2\""
|
|
fi
|
|
}
|
|
|
|
function assertStringContains() {
|
|
if ! echo "$1" | grep -q "$2" ; then
|
|
fail "expected \"$1\" to contain \"$2\""
|
|
fi
|
|
}
|