From a219c9faaa7622910d3472853ab648581174aeb4 Mon Sep 17 00:00:00 2001 From: dweiller <4678790+dweiller@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:53:30 +1100 Subject: [PATCH] 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. --- test/behavior/slice.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/behavior/slice.zig b/test/behavior/slice.zig index 44d8e7bcc..bf55f4f23 100644 --- a/test/behavior/slice.zig +++ b/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);