zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

test_pointer_coerce_const_optional.zig (325B) - Raw


      1 const std = @import("std");
      2 const expect = std.testing.expect;
      3 const mem = std.mem;
      4 
      5 test "cast *[1][*:0]const u8 to []const ?[*:0]const u8" {
      6     const window_name = [1][*:0]const u8{"window name"};
      7     const x: []const ?[*:0]const u8 = &window_name;
      8     try expect(mem.eql(u8, mem.span(x[0].?), "window name"));
      9 }
     10 
     11 // test