stdlib::testing
defined in C:\Users\bye45\.glide\bin/src/stdlib/testing.glide
Fails the current test if `cond` is false. The macro evaluates `cond`
Fails the current test if cond is false. The macro evaluates cond once; build descriptive context into the expression itself or use assert_eq! / assert_str_eq! for tailored failure messages.
assert!(v.len() > 0);
assert!(user.age >= 18);
Like assert! but takes a custom failure message. The message is a regular string expression, so string interpolation works:
let n: int = compute();
assert_msg!(n > 0, "expected positive, got ${n}");
Numeric / boolean / char equality. Uses C ==, so DON'T use this for strings — reach for assert_str_eq! instead. On failure, prints both values via format!'s type-aware formatter.
assert_eq!(parse_int("42").val, 42);
assert_eq!(true, !false);
String equality via .eq(). assert_eq! would compare pointers and almost always fail; use this whenever either side is a string.
assert_str_eq!(name.to_lower(), "alice");
Convenience for assert!(!cond) with a clearer failure message.
Mark the start of a test. The glide test driver emits this before calling each test_* function; manual callers don't need it. Public so the synthesised driver code can reach it across modules.
Tick the per-test pass counter. Called by the driver after a test returns without any failed assertion.
Print the run summary (N passed, M failed) and return the number of failed tests. The driver uses the return as the process exit code.
(passed, failed) for the current run. Useful for self-tests of the framework.