tap.clean_testThis command removes previously outputed test log files if they exist.
tap.planvoid tap.plan(int n, String skip_reason = 0)
This allows setting a plan, so we know how many tests will be run. Just use it once for the group of tests following. If you want to start a new test, after a plan has been set, remember to call
tap.done_testing() before.
Alternatively, you can pass
NO_PLAN if you have no plan.
If the following tests are to be skipped, pass [
SKIP_ALL, so all tests until next plan are skipped. They will still be executed, they just won't output log or be considered whether they fail or succeed.
tap.okvoid tap.ok(bool condition, String test_name = 0)
This test will succeed if the condition is true, and fail if the condition is false.
tap.nokvoid tap.nok(bool condition, String test_name = 0)
This test will succeed if the condition is false, and fail if the condition is true.
tap.isvoid tap.is(String got, String expected, String test_name = 0)
This test will succeed if
got and
expected matches. If this test fails, we can have some more diagnostic information since we know both inputs and the premise they are supposed to match.
tap.isntvoid tap.isnt(String got, String expected, String test_name = 0)
This test will succeed if
got and
expected does not matches. If this test fails, we can have some more diagnostic information since we know both inputs and the premise they are not supposed to match.
tap.is_intvoid tap.is_int(int got, int expected, String test_name = 0)
This test will succeed if
got and
expected matches. If this test fails, we can have some more diagnostic information since we know both inputs and the premise they are supposed to match. This is for
int values.
tap.isnt_intvoid tap.isnt_int(int got, int expected, String test_name = 0)
This test will succeed if
got and
expected does not matches. If this test fails, we can have some more diagnostic information since we know both inputs and the premise they are not supposed to match. This is for
int values.
tap.is_floatvoid tap.is_float(float got, float expected, float epsilon, String test_name = 0)
This test will succeed if
got and
expected matches. If this test fails, we can have some more diagnostic information since we know both inputs and the premise they are supposed to match. This is for
float values.
tap.isnt_floatvoid tap.isnt_float(float got, float expected, float epsilon, String test_name = 0)
This test will succeed if
got and
expected does not matches. If this test fails, we can have some more diagnostic information since we know both inputs and the premise they are not supposed to match. This is for
float values.
tap.done_testingAfter you are done testing, before calling the next plan, state you are done testing.
tap.HarnessThis outputs a small summary of currently tests and failures. Don't depend on this output format.