mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
11 lines
348 B
Zig
11 lines
348 B
Zig
const std = @import("std");
|
|
const expectEqualStrings = std.testing.expectEqualStrings;
|
|
const mem = std.mem;
|
|
|
|
test "cast *[1][*:0]const u8 to []const ?[*:0]const u8" {
|
|
const window_name = [1][*:0]const u8{"window name"};
|
|
const x: []const ?[*:0]const u8 = &window_name;
|
|
try expectEqualStrings("window name", mem.span(x[0].?));
|
|
}
|
|
|
|
// test
|