File util/test.lua
loveui is a love2d library to provide resuable GUI widgets to love2d developers.
Functions
checktype (name, value, ...) | Checks the type of a value |
test (name, case) | Tests a test case. |
Functions
- checktype (name, value, ...)
-
Checks the type of a value
Parameters
- name: The variable name.
- value: The value whose type to check.
- ...: Types that a valid.
- test (name, case)
-
Tests a test case. Prints a message when test fails, but does not raise error. To fail a test, throw an error or return false. To pass a test, return true.
Parameters
- name: The name of the test case.
- case: A function that returns false if the test failed.