-
Notifications
You must be signed in to change notification settings - Fork 0
Matcher
Tim edited this page Sep 19, 2015
·
3 revisions
These follow the syntax described in Syntax.
| Matcher | Matches |
|---|---|
_ |
anything |
true |
true |
truthy |
anything but false or nil
|
false |
false |
falsy |
false or nil
|
nil |
nil |
-- match identity of objects
ref(reference)
--- match general identity: `expected == actual`
equal(value)
equals(value)--- match deep compared tables
same(table)
--- match sets
unique(deep)
--- match subsets
is_subset_of(table)
--- match values that are set to a key or any key of a table
is_value_of(table, [key])near(value, tolerance)match(pattern, [init, [plain]])
matches(pattern, [init, [plain]])pattern, init are defined as with string.match. If plain is defined, string.find is used instead.
Also see the chapter on patterns.
booleannumberstringtableniluserdatafunctionthread
none_of(matchers, ...)
any_of(matchers, ...)
all_of(matchers, ...)--- match anything that is in creative inventory
in_creative_inventory(itemdef_or_name)