1 const std = @import("std");
3 test "expect addOne adds one to 41" {
5 // The Standard Library contains useful functions to help create tests.
6 // `expect` is a function that verifies its argument is true.
7 // It will return an error if its argument is false to indicate a failure.
8 // `try` is used to return an error to the test runner to notify it that the test failed.
9 try std.testing.expect(addOne(41) == 42);
13 // A test name can also be written using an identifier.
14 // This is a doctest, and serves as documentation for `addOne`.
15 try std.testing.expect(addOne(41) == 42);
18 /// The function `addOne` adds one to the number given as its argument.
19 fn addOne(number: i32) i32 {