Module: test.framework
Source: ./test/framework.reef
Overview
test/framework - Minimal test framework for Reef
Provides basic assertion functions and test result tracking using an Active Object for thread-safe mutable state.
Active Objects
TestRunner
TestRunner active object - holds mutable test state
Fields:
| Name | Type |
|---|---|
count |
int |
passed |
int |
failed |
int |
Methods:
exclusive proc assert_eq_int(actual: int, expected: int, message: string)
Assert that two integers are equal
exclusive proc assert_eq_bool(actual: bool, expected: bool, message: string)
Assert that two booleans are equal
exclusive proc assert_eq_string(actual: string, expected: string, message: string)
Assert that two strings are equal
exclusive proc assert_eq_float(actual: float, expected: float, epsilon: float, message: string)
Assert that two floats are equal within epsilon tolerance
exclusive proc assert_true(condition: bool, message: string)
Assert that a condition is true
exclusive proc assert_false(condition: bool, message: string)
Assert that a condition is false
exclusive proc assert_not_eq_int(actual: int, unexpected: int, message: string)
Assert that two integers are NOT equal
exclusive proc assert_not_eq_bool(actual: bool, unexpected: bool, message: string)
Assert that two booleans are NOT equal
exclusive proc assert_not_eq_string(actual: string, unexpected: string, message: string)
Assert that two strings are NOT equal
exclusive proc assert_contains_string(haystack: string, needle: string, message: string)
Assert that haystack contains needle (substring match).
NOTE: an empty needle always matches per core.str.contains semantics (the empty string is a substring of every string). If you're seeing unexpected passes from this assertion, check that your needle isn't accidentally empty. The framework prints a "WARN: empty needle" notice in that case so silently-vacuous assertions are visible in test output.
exclusive proc report()
Print test summary report
proc run()
Generated by reefc doc