Commit b7e72cc421

Yuri Pieters <magejohnyjtp@gmail.com>
2020-04-09 03:00:08
sort.binarySearch: test for regresson of #4980
1 parent 447dc2b
Changed files (1)
lib
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),