- Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.test.ts
27 lines (24 loc) · 596 Bytes
/
index.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import*asassertsfrom"https://deno.land/std@0.125.0/testing/asserts.ts";
import*aslogfrom"https://deno.land/std@0.125.0/log/mod.ts";
import{majorityElement}from"./index.ts";
log.info("169. Majority Element");
Deno.test({
name: `
Input: [3,2,3]
Output: 3
`,
fn(): void{
constresult: number=majorityElement([3,2,3]);
asserts.assertEquals(3,result);
},
});
Deno.test({
name: `
Input: [2, 2, 1, 1, 1, 2, 2]
Output: 2
`,
fn(): void{
constresult: number=majorityElement([2,2,1,1,1,2,2]);
asserts.assertEquals(2,result);
},
});