Assert
mash.assert · Utilities
Methods
Section titled “Methods”contains
Section titled “contains”assert.contains(tag: string, haystack: mixed, needle: mixed) → bool
A string contains text, or a list/collection holds a value (typed).
assert.equal(tag: string, actual: mixed, expected: mixed) → bool
Typed equality (see the class note).
isFalse
Section titled “isFalse”assert.isFalse(tag: string, value: mixed) → bool
No description yet.
isNull
Section titled “isNull”assert.isNull(tag: string, value: mixed) → bool
No description yet.
isTrue
Section titled “isTrue”assert.isTrue(tag: string, value: mixed) → bool
No description yet.
assert.near(tag: string, actual: mixed, expected: mixed, tolerance?: float = 0.000001) → bool
Numbers within $tolerance of each other (floating point).
notEqual
Section titled “notEqual”assert.notEqual(tag: string, actual: mixed, unexpected: mixed) → bool
No description yet.
notNull
Section titled “notNull”assert.notNull(tag: string, value: mixed) → bool
No description yet.
throws
Section titled “throws”assert.throws(tag: string, block: mixed, messageContains?: string) → bool
The block raises an error, and its message contains $messageContains when given. Errors a statement records (mash.error) count as well as ones that end the block, and are cleared afterwards so they do not leak into the test. A time limit is never caught.
unreachable
Section titled “unreachable”assert.unreachable(tag: string, why?: string = "") → bool
Fail unconditionally, on a branch that should not be reached (fail is a keyword).