test/behavior: fix test type check for multi-ptr slice

The original test was checking the types of irrelevant slices, the test
is for slicing of multi-pointers _without_ an end value, but the types
of slices with an end value were being checked.
This commit is contained in:
dweiller 2024-01-15 16:53:30 +11:00
parent 8108c9f4d2
commit a219c9faaa

View File

@ -376,9 +376,8 @@ test "slice multi-pointer without end" {
var array = [5:0]u8{ 1, 2, 3, 4, 5 };
const pointer: [*:0]u8 = &array;
comptime assert(@TypeOf(pointer[1..3]) == *[2]u8);
comptime assert(@TypeOf(pointer[1..3 :4]) == *[2:4]u8);
comptime assert(@TypeOf(pointer[1..5 :0]) == *[4:0]u8);
comptime assert(@TypeOf(pointer[1..]) == [*:0]u8);
comptime assert(@TypeOf(pointer[1.. :0]) == [*:0]u8);
const slice = pointer[1..];
comptime assert(@TypeOf(slice) == [*:0]u8);