From b7e72cc4211d7b06e2b7095f48c579ce1daaf253 Mon Sep 17 00:00:00 2001 From: Yuri Pieters Date: Thu, 9 Apr 2020 02:00:08 +0100 Subject: [PATCH] sort.binarySearch: test for regresson of #4980 --- lib/std/sort.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/std/sort.zig b/lib/std/sort.zig index 91d29dd22d..c6dcaac49e 100644 --- a/lib/std/sort.zig +++ b/lib/std/sort.zig @@ -47,6 +47,10 @@ test "std.sort.binarySearch" { @as(?usize, null), binarySearch(u32, 1, &[_]u32{0}, S.order_u32), ); + testing.expectEqual( + @as(?usize, null), + binarySearch(u32, 0, &[_]u32{1}, S.order_u32), + ); testing.expectEqual( @as(?usize, 4), binarySearch(u32, 5, &[_]u32{ 1, 2, 3, 4, 5 }, S.order_u32),