authorgravatar for magejohnyjtp@gmail.comYuri Pieters <magejohnyjtp@gmail.com> 2020-04-09 02:00:08+01:00
committergravatar for magejohnyjtp@gmail.comYuri Pieters <magejohnyjtp@gmail.com> 2020-04-09 02:00:08+01:00
logb7e72cc4211d7b06e2b7095f48c579ce1daaf253
tree001e5af6482c0ad4372d2742680b31a3503bd84e
parent447dc2bb9011078e80acbe3f51135ff1ad2bf163

sort.binarySearch: test for regresson of #4980


1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/sort.zig+4
......@@ -47,6 +47,10 @@ test "std.sort.binarySearch" {
4747 @as(?usize, null),
4848 binarySearch(u32, 1, &[_]u32{0}, S.order_u32),
4949 );
50 testing.expectEqual(
51 @as(?usize, null),
52 binarySearch(u32, 0, &[_]u32{1}, S.order_u32),
53 );
5054 testing.expectEqual(
5155 @as(?usize, 4),
5256 binarySearch(u32, 5, &[_]u32{ 1, 2, 3, 4, 5 }, S.order_u32),