nixpkgs/pkgs/development/interpreters/lua-5/tests/assert.sh
Matthieu Coudron c4b5c2574b lua: test the interpreter
Test with:
nix-build -A lua.tests pass

Tests are very limited for now, goal is mostly to put the infra into
place and enrich the tests when dealing with lua issues.
add luaPath/luaCpath as passthrough
makes it easier to generate LUA_PATH/LUA_CPATH
2022-10-14 00:10:40 +02:00

17 lines
272 B
Bash

# Always failing assertion with a message.
#
# Example:
# fail "It should have been but it wasn't to be"
function fail() {
echo "$1"
exit 1
}
function assertStringEqual {
if ! diff <(echo "$1") <(echo "$2") ; then
fail "Strings differ"
fi
}