luvit/tap - `unexpect` function calls
It would be nice to have an unexpect companion to expect - if that function is ever called, it is always an error.
It is currently possible to use function(...) assert(false, ...) end instead of unexpect, but that throws ugly "Uncaught Error"s.
No need for assert(false, ...) just do error(...). I don't see how an unexpect would help, it would just internally call error() right?
An unwrapped function() with an error() will kill the process, won't it? (Which would not be very nice, as it would not allow the following tests to run.) Additionally unexpected(error_message) would be a little bit more explicit, IMO.
I think a simple error("this should not have happened because...") is plenty explicit. The issue about uncaught errors causing fatal exist is a problem though. I'll think about a way to solve this.
Maybe the failed-test-notification logic with which expect() deals with error()s could be replicated somehow for functions that are not expected to be executed. But that would probably mean implementing something like unexpected().