Module test
A simple utility for testing values and running unit tests.
Functions
equals (expected, actual, message) | Test if the given value matches the given expected value. |
run (name, test_method) | Runs the given method and prints a formatted information including the name. |
start (name) | Prints the given name as header. |
Functions
- equals (expected, actual, message)
-
Test if the given value matches the given expected value.
If the values do not match, an error with the given message (if any) and
an additional message containing both values will be shown.
The values will be compared with ==.
Parameters:
- expected The expected value.
- actual The actual value.
- message Optional. The additional message to be printed.
- run (name, test_method)
-
Runs the given method and prints a formatted information including the name.
Parameters:
- name The name of the method that is being run.
- test_method The method to run.
- start (name)
-
Prints the given name as header.
Parameters:
- name The name of the header.