mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
12 lines
208 B
Zig
12 lines
208 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "0-terminated slice" {
|
|
const slice: [:0]const u8 = "hello";
|
|
|
|
try expect(slice.len == 5);
|
|
try expect(slice[5] == 0);
|
|
}
|
|
|
|
// test
|