authorgravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2024-01-15 16:53:30+11:00
committergravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2024-01-15 20:55:01+11:00
loga219c9faaa7622910d3472853ab648581174aeb4
tree71d808c6a8069cf9ade06c2979ebd707ac97a18c
parent8108c9f4d2580680e3ed2fc6a289b1af1c939b5c

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 files changed, 2 insertions(+), 3 deletions(-)

test/behavior/slice.zig+2-3
...@@ -376,9 +376,8 @@ test "slice multi-pointer without end" {...@@ -376,9 +376,8 @@ test "slice multi-pointer without end" {
376 var array = [5:0]u8{ 1, 2, 3, 4, 5 };376 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
377 const pointer: [*:0]u8 = &array;377 const pointer: [*:0]u8 = &array;
378378
379 comptime assert(@TypeOf(pointer[1..3]) == *[2]u8);379 comptime assert(@TypeOf(pointer[1..]) == [*:0]u8);
380 comptime assert(@TypeOf(pointer[1..3 :4]) == *[2:4]u8);380 comptime assert(@TypeOf(pointer[1.. :0]) == [*:0]u8);
381 comptime assert(@TypeOf(pointer[1..5 :0]) == *[4:0]u8);
382381
383 const slice = pointer[1..];382 const slice = pointer[1..];
384 comptime assert(@TypeOf(slice) == [*:0]u8);383 comptime assert(@TypeOf(slice) == [*:0]u8);