Skip to content

Commit 1f6fd61

Browse files
committed
Create test.ts
1 parent 16c82f9 commit 1f6fd61

File tree

1 file changed

+19
-0
lines changed
  • find-servers-that-handled-most-number-of-requests

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
2+
import busiestServers from "./index.ts";
3+
Deno.test("find-servers-that-handled-most-number-of-requests", () => {
4+
assertEquals(
5+
[
6+
[3, [1, 2, 3, 4, 5], [5, 2, 3, 3, 3]],
7+
[3, [1, 2, 3, 4], [1, 2, 1, 2]],
8+
[3, [1, 2, 3], [10, 12, 11]],
9+
[
10+
7,
11+
[1, 3, 4, 5, 6, 11, 12, 13, 15, 19, 20, 21, 23, 25, 31, 32],
12+
[9, 16, 14, 1, 5, 15, 6, 10, 1, 1, 7, 5, 11, 4, 4, 6],
13+
],
14+
[1, [1], [1]],
15+
[3, [1, 2, 3, 4, 8, 9, 10], [5, 2, 10, 3, 1, 2, 2]],
16+
].map((a) => Reflect.apply(busiestServers, null, a)),
17+
[[1], [0], [0, 1, 2], [0], [0], [1]],
18+
);
19+
});

0 commit comments

Comments
 (0)