Module macro.libs.test

assert_ macro library support.

This module may of course be used on its own; assert_ merely provides some syntactical sugar for its functionality. It is based on Penlight's pl.test module.

Functions

assert_eq (v1, v2) assert if parameters are not equal.
assert_lt (v1, v2) assert if first parameter is not less than second.
assert_gt (v1, v2) assert if first parameter is not greater than second.
assert_match (v1, v2) assert if first parameter string does not match the second.
tuple (...) create a tuple capturing multiple return values.


Functions

assert_eq (v1, v2)
assert if parameters are not equal. If the values are tables, they will be compared by value.

Parameters:

  • v1: given value
  • v2: test value
assert_lt (v1, v2)
assert if first parameter is not less than second.

Parameters:

  • v1: given value
  • v2: test value
assert_gt (v1, v2)
assert if first parameter is not greater than second.

Parameters:

  • v1: given value
  • v2: test value
assert_match (v1, v2)
assert if first parameter string does not match the second. The condition is v1:match(v2).

Parameters:

  • v1: given value
  • v2: test value
tuple (...)
create a tuple capturing multiple return values. Equality between tuples means that all of their values are equal; values may be nil

Parameters:

  • ...: any values

Returns:

    a tuple object