Commit Graph

12 Commits

Author SHA1 Message Date
TurtleP
57922d4890 Merge branch 'master' into turtlep/one_of_bugfix 2023-03-27 17:09:11 -04:00
TurtleP
01b7dd000f fix assert:one_of for non-string values 2023-03-24 23:24:24 -04:00
TurtleP
4cbbf6c068 address pr comment 2023-03-20 09:48:56 -04:00
TurtleP
c2316e2ad8 don't remove this whitespace 2023-03-19 12:19:57 -04:00
TurtleP
2c31336210 add assert.one_of 2023-03-19 12:19:08 -04:00
Max Cahill
b6ca4c7740
Merge pull request #53 from idbrii/fix-async-lovejs
async: Skip wrapping with xpcall under lovejs
2022-03-07 10:50:36 +11:00
David Briscoe
a030a20985 async: Assert that args is a table; add type_or_nil
If args is valid, assert it's a table.

Provides a clear and immediate error message when you convert
add_timeout() to call().

Also add type_or_nil. Very useful for optional parameters like this one.
Seems clearer than checking the arg first:
    if args then assert:type() end
2022-03-06 00:25:24 -08:00
David Briscoe
a5ebc1e501 lint: Fix shadow issues
Fix shadowing by using variables with a different name or _.

I don't think any of these warnings were actual bugs and fixed them to
maintain the same behaviour.
2022-03-03 10:17:34 -08:00
Max Cahill
591ba1d7a9 [added] assert methods return first argument so they can be used inline 2020-05-29 16:20:26 +10:00
Max Cahill
1610092bd1 [modified] renamed assert:equals to assert:equal for consistency
[added] assert:not_equal
2020-05-19 13:01:56 +10:00
Max Cahill
a367d18b51 [added] assert:some for nil checks 2020-05-19 13:00:23 +10:00
Max Cahill
cf7354d75f [added] assert module with some "nicer" assertions 2020-05-19 12:03:04 +10:00