behavior tests: remove one dependency on std lib

This commit is contained in:
Andrew Kelley 2025-09-07 20:22:56 -07:00
parent 04bd30f021
commit 2d9df0bb1a

View File

@ -103,7 +103,11 @@ test "basic extern unions" {
var foo = FooExtern{ .int = 1 };
try expect(foo.int == 1);
foo.str.slice = "Well";
try expect(std.mem.eql(u8, std.mem.sliceTo(foo.str.slice, 0), "Well"));
try expect(foo.str.slice[0] == 'W');
try expect(foo.str.slice[1] == 'e');
try expect(foo.str.slice[2] == 'l');
try expect(foo.str.slice[3] == 'l');
try expect(foo.str.slice[4] == 0);
}
const ExternPtrOrInt = extern union {