lunatest icon indicating copy to clipboard operation
lunatest copied to clipboard

Add an assert_not_error function

Open xordspar0 opened this issue 4 years ago • 0 comments

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.

xordspar0 avatar Sep 05 '19 02:09 xordspar0