Test Runner
rqio test
Section titled “rqio test”RayQuiro 0.2.2 comes with a built-in automated test runner.
# Run all tests in the project (searches tests/ or *_test.rq files)rqio test
# Run tests in a specific directory or filerqio test tests/01_basic_syntax.rqrqio test tests/Writing Tests
Section titled “Writing Tests”You can write tests with assertions directly in your script:
var name = "RayQuiro";var ver = 2;
var banner = f"{name} v0.{ver}";assert_eq(banner, "RayQuiro v0.2");
var status = 200;var statusText = "";match status { 200 => statusText = "OK", 404 => statusText = "Not Found", _ => statusText = "Unknown"}assert_eq(statusText, "OK");
assert(10 > 5, "Math check failed");assert_true(true);assert_false(false);assert_null(null);assert_ne(1, 2);Assertion Functions
Section titled “Assertion Functions”| Function | Description |
|---|---|
assert(condition, message) | Asserts that condition is truthy |
assert_eq(actual, expected, message) | Asserts that actual == expected |
assert_ne(actual, expected, message) | Asserts that actual != expected |
assert_true(value, message) | Asserts that value is true |
assert_false(value, message) | Asserts that value is false |
assert_null(value, message) | Asserts that value is null |