mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
parent
c3b85e4e2f
commit
6fc71835c3
@ -2621,6 +2621,7 @@ pub const Value = extern union {
|
||||
|
||||
.zero,
|
||||
.one,
|
||||
.null_value,
|
||||
.int_u64,
|
||||
.int_i64,
|
||||
.int_big_positive,
|
||||
|
||||
@ -396,3 +396,12 @@ test "slice as parameter type" {
|
||||
try expect(S.internComptimeString(source_a[1..2]) == S.internComptimeString(source_a[1..2]));
|
||||
try expect(S.internComptimeString(source_a[2..4]) != S.internComptimeString(source_a[5..7]));
|
||||
}
|
||||
|
||||
test "null sentinel pointer passed as generic argument" {
|
||||
const S = struct {
|
||||
fn doTheTest(a: anytype) !void {
|
||||
try std.testing.expect(@ptrToInt(a) == 8);
|
||||
}
|
||||
};
|
||||
try S.doTheTest((@intToPtr([*:null]const [*c]const u8, 8)));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user