Files
hakorune/apps/libs/test_assert.hako

17 lines
400 B
Plaintext

// TestAssertBox: tiny assertions for scripts
static box TestAssertBox {
assert_eq(actual, expected, msg) {
if actual == expected { return true }
print("[ASSERT_EQ FAIL] " + msg)
print(" expected: " + expected)
print(" actual : " + actual)
return false
}
assert_true(cond, msg) {
if cond { return true }
print("[ASSERT_TRUE FAIL] " + msg)
return false
}
}