about things
1# testing
2
3`zig build test` compiles tests but may not run them if your build.zig doesn't wire it up correctly. to actually run tests:
4
5```bash
6zig test src/foo.zig # runs tests in foo.zig and its imports
7zig test src/foo.zig --test-filter "parse" # only tests matching "parse"
8```
9
10the testing allocator catches leaks. if you use `parseFromValueLeaky` or similar "leaky" apis, wrap in an arena:
11
12```zig
13var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
14defer arena.deinit();
15const result = try leakyFunction(arena.allocator(), input);
16```