/lua-test-driven-learning

Learn Lua by writing tests

Primary LanguageLuaMIT LicenseMIT

Lua Test Driven Learning

Installation

This project uses LuaUnit and LuaRocks.

brew install luarocks
luarocks install luaunit

Running tests

Lua checks the environment variable LUA_PATH to determine the path to look for libraries when the require function is called.

The LuaRocks CLI tool provides a way to set up LUA_PATH so that Lua can use the libraries.

# Set environment variables for Lua to load libraries
eval "$(luarocks path --bin)"

# Run a test
lua syntax-test.lua

Or you can use the test.sh script:

# Run a test
./test.sh syntax-test.lua

# Run tests with all Lua files
./test.sh *lua

See also

License

MIT