Awkl
Loading...
Searching...
No Matches
test.awk File Reference

Namespaces

namespace  test
 

Functions

unassigned test::import ()
 Import functions as strings in the awk namespace.
 
unassigned test::add (string|array< string > names)
 Add tests' names to be run.
 
unassigned test::printSummary ()
 Print the tests summary.
 
bool test::testOne (string tname)
 Run a single test in a test set.
 
auto test::runTests (string|array< string > names, number exit_f=0, number import_f=1) -> bool|never
 Run a set of tests.
 
unassigned test::it (string d)
 Set a description for the current test.
 
unassigned test::_assert (any x, string msg_ok, string msg_bad)
 Underlying assert function.
 
unassigned test::assertTruthy (any x)
 Assert whether a variable is truthy.
 
unassigned test::assertFalsy (any x)
 Assert whether a variable is falsy.
 
unassigned test::assertTrue (any x)
 Assert whether a variable is true (number|bool 1)
 
unassigned test::assertFalse (any x)
 Assert whether a variable is true (number|bool 0)
 
unassigned test::assert (any x)
 Alias for test::assertTruthy
 
unassigned test::assertOp (any x, any e, string op, string sym, string pre, string post)
 Assert whether a binary operation on two variables is truthy.
 
unassigned test::assertOpTrue (any x, any e, string op, string sym)
 Assert whether a binary operation on two variables is truthful.
 
unassigned test::assertEq (scalar x, scalar e)
 Assert whether a variable is equal to another.
 
unassigned test::assertEq (array X, array E)
 Assert whether all elements in an array are equal to the ones in another.
 
unassigned test::assertNe (scalar x, scalar e)
 Assert whether a variable is not equal to another.
 
unassigned test::assertNe (array X, array E)
 Assert whether all elements in an array are not equal to the ones in another.
 
unassigned test::assertLt (scalar x, scalar e)
 Assert whether a variable is less than another.
 
unassigned test::assertLt (array X, array E)
 Assert whether all elements in an array are less than the ones in another.
 
unassigned test::assertLe (scalar x, scalar e)
 Assert whether a variable is less than or equal another.
 
unassigned test::assertLe (array X, array E)
 Assert whether all elements in an array are less than or equal to the ones in another.
 
unassigned test::assertGt (scalar x, scalar e)
 Assert whether a variable is greater than another.
 
unassigned test::assertGt (array X, array E)
 Assert whether all elements in an array are greater than the ones in another.
 
unassigned test::assertGe (scalar x, scalar e)
 Assert whether a variable is greater than or equal another.
 
unassigned test::assertGe (array X, array E)
 Assert whether all elements in an array are greater than or equal to the ones in another.
 
unassigned test::assertMatch (scalar x, scalar e)
 Assert whether a variable matches a regular expression.
 
unassigned test::assertMatch (array X, array E)
 Assert whether all elements in an array match a regular expression.
 
unassigned test::assertNomatch (scalar x, scalar e)
 Assert whether a variable does not match a regular expression.
 
unassigned test::assertNomatch (array X, array E)
 Assert whether all elements in an array do not match a regular expression.
 
unassigned test::assertApprox (number x, number e, numeric rt=0.01, numeric at=0.00)
 Assert whether a variable is approximately equal to another.
 
unassigned test::assertApprox (array X, array E, numeric rt=0.01, numeric at=0.00)
 Assert whether all elements in an array are approximately equal to the ones in another.
 
unassigned test::assertInside (any x, array A)
 Assert whether a variable is an element of an array.
 
unassigned test::assertContains (array A, any x)
 Assert whether an array contains an element.
 
unassigned test::assertSetInside (scalar x, set A)
 Assert whether a variable is an element of a set.
 
unassigned test::assertSetInside (set A, set B)
 Assert whether a set is a (non-strict) subset of another.
 
unassigned test::assertSetContains (set A, scalar x)
 Assert whether a set contains an element.
 
unassigned test::assertSetContains (set A, set B)
 Assert whether a set is a (non-strict) superset of another.
 
unassigned test::assertType (any x, string type)
 Assert whether variable is of a specific type.
 

Variables

number test::conf ["assertion"]["print"] = 0