| ... | @@ -1385,6 +1385,10 @@ test "slice" { | ... | @@ -1385,6 +1385,10 @@ test "slice" { |
| 1385 | const value = @intToPtr([*]align(1) const []const u8, 0xdeadbeef)[runtime_zero..runtime_zero]; | 1385 | const value = @intToPtr([*]align(1) const []const u8, 0xdeadbeef)[runtime_zero..runtime_zero]; |
| 1386 | try testFmt("slice: []const u8@deadbeef\n", "slice: {}\n", .{value}); | 1386 | try testFmt("slice: []const u8@deadbeef\n", "slice: {}\n", .{value}); |
| 1387 | } | 1387 | } |
| | 1388 | { |
| | 1389 | const null_term_slice: [:0]const u8 = "\x00hello\x00"; |
| | 1390 | try testFmt("buf: \x00hello\x00\n", "buf: {s}\n", .{null_term_slice}); |
| | 1391 | } |
| 1388 | | 1392 | |
| 1389 | try testFmt("buf: Test\n", "buf: {s:5}\n", .{"Test"}); | 1393 | try testFmt("buf: Test\n", "buf: {s:5}\n", .{"Test"}); |
| 1390 | try testFmt("buf: Test\n Other text", "buf: {s}\n Other text", .{"Test"}); | 1394 | try testFmt("buf: Test\n Other text", "buf: {s}\n Other text", .{"Test"}); |