// m3te logic-test assert helper.
//
// `expect(cond, msg)` is a no-op when `cond` holds. On a false condition it
// prints a single greppable `FAIL <file>:<line>: <msg>` line to stdout and
// terminates the process NON-ZERO (exit 1) via process.exit, so a broken
// assertion fails `tools/run_tests.sh` and the build gate.
#import "modules/std.sx";
proc :: #import "modules/process.sx";

expect :: (cond: bool, msg: string, loc: Source_Location = #caller_location) {
    if !cond {
        print("FAIL {}:{}: {}\n", loc.file, loc.line, msg);
        proc.exit(1);
    }
}
