About testlib.vase

This file contains the test library functions for Jarlang. It provides basic assertion helpers, pass/fail counters, and reporting for test suites.

Test Counters

NameTypeDescription
TEST_PASSESVariableCounts the number of passing tests.
TEST_FAILSVariableCounts the number of failing tests.

Assertions

FunctionSignatureDescription
assert_eqassert_eq(expected, actual, label)Checks if expected == actual. Reports pass/fail with label.
assert_neassert_ne(expected, actual, label)Checks if expected != actual. Reports pass/fail with label.
assert_trueassert_true(value, label)Checks if value is true (1 or non-empty string). Reports pass/fail with label.
assert_falseassert_false(value, label)Checks if value is false (0 or empty string). Reports pass/fail with label.

Helpers

FunctionSignatureDescription
report_passreport_pass(label)Increments TEST_PASSES and prints a pass message.
report_failreport_fail(label, expected, actual)Increments TEST_FAILS and prints a fail message.

Summary & Reset

FunctionSignatureDescription
test_summarytest_summary()Prints a summary of passes and fails.
test_resettest_reset()Resets TEST_PASSES and TEST_FAILS to zero.