Commit a219c9faaa

dweiller <4678790+dweiller@users.noreply.github.com>
2024-01-15 06:53:30
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.
1 parent 8108c9f
Changed files (1)
test
behavior
test/behavior/slice.zig
@@ -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);