Module pl.test

Functions

asserteq (x, y) like assert, except takes two arguments that must be equal and can be tables.
asserteq2 (x1, x2, y1, y2) a version of asserteq that takes two pairs of values.
timer (msg, n, fun, ...) Time a function.


Functions

asserteq (x, y)
like assert, except takes two arguments that must be equal and can be tables. If they are plain tables, it will use tablex.deepcompare.

Parameters:

  • x: any value
  • y: a value equal to x
asserteq2 (x1, x2, y1, y2)
a version of asserteq that takes two pairs of values. x1==y1 and x2==y2 must be true. Useful for functions that naturally return two values.

Parameters:

  • x1: any value
  • x2: any value
  • y1: any value
  • y2: any value
timer (msg, n, fun, ...)
Time a function. Call the function a given number of times, and report the number of seconds taken, together with a message. Any extra arguments will be passed to the function.

Parameters:

  • msg: a descriptive message
  • n: number of times to call the function
  • fun: the function
  • ...:

Valid XHTML 1.0!