| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This example demonstrates how to write and execute unit tests utilizing the built-in test annotation and assertions.
use test
say "Registering unit tests..."
test do test_math_assertions()
result = 5 * 5
test.assert_equals(result, 25)
end
test do test_logical_truth()
test.assert(10 > 5)
end
say "Executing unit tests..."
test.run_all()
tech run unit_test.txs
# or
tech testRegistering unit tests... Executing unit tests... Running 2 tests... [PASS] test_math_assertions [PASS] test_logical_truth Test result: 2 passed, 0 failed.
| Back | FazBrowse Home | New Git URL |