lunarmodules / luassert

Assertion library for Lua
MIT License
202 stars 77 forks source link

Asserts return all their arguments on success #115

Closed o-lim closed 9 years ago

o-lim commented 9 years ago

This updates assertions to return all of their arguments on success, just like assert.

assert (v [, message])

Issues an error when the value of its argument v is false (i.e., nil or false); otherwise, returns all its arguments. message is an error message; when absent, it defaults to "assertion failed!"

o-lim commented 9 years ago

Rebased on top of PR #113, and updated error assertions to return the thrown error.