lunatest
lunatest copied to clipboard
Add an assert_not_error function
Currently if I want to test that a function runs normally and doesn't return an error, I just run the function and don't try to catch the error.
function t.test_no_errors()
might_error()
end
This is fine because lunatest runs all test cases inside pcall
. However, if my function does return an error, lunatest reports the test case as having an error rather than a failed assertion. I would like to be able to consider this case as a failure, not a general error.