Running Tests
In this guide, code examples are often given as runnable tests. Before proceeding, make sure that you can run them successfully.
Success
Save the following text as test_pass.zig
, and run zig test test_pass.zig
; you should read All 1 tests passed.
in your terminal.
Failure
Now, save the following text as test_fail.zig
and observe it fail.
Which should output something like: