Slices

    1. 1/1 test "basic slices"...index out of bounds
    2. /deps/zig/docgen_tmp/test.zig:22:10: 0x204cc6 in test "basic slices" (test)
    3. slice[10] += 1;
    4. ^
    5. /deps/zig/lib/std/special/test_runner.zig:47:28: 0x22bc1e in std.special.main (test)
    6. } else test_fn.func();
    7. ^
    8. const result = root.main() catch |err| {
    9. ^
    10. /deps/zig/lib/std/start.zig:123:5: 0x20548f in std.start._start (test)
    11. @call(.{ .modifier = .never_inline }, posixCallMainAndExit, .{});
    12. ^
    13. Tests failed. Use the following command to reproduce the failure:

    This is one reason we prefer slices to pointers.

    1. $ zig test slices.zig
    2. 2/2 test "slice pointer"...OK
    3. All 2 tests passed.

    See also:

    null_terminated_slice.zig

    1. $ zig test null_terminated_slice.zig
    2. All 1 tests passed.