- Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.test.ts
49 lines (44 loc) · 1010 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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{findShortestSubArray}from"./index.ts";
log.info("697. Degre of an Array");
Deno.test({
name: `
Input: [1, 2, 2, 3, 1]
Output: 2
`,
fn(): void{
constresult: number=findShortestSubArray([1,2,2,3,1]);
asserts.assertEquals(2,result);
},
});
Deno.test({
name: `
Input: [1, 1, 1, 1, 1, 1]
Output: 6
`,
fn(): void{
constresult: number=findShortestSubArray([1,1,1,1,1,1]);
asserts.assertEquals(6,result);
},
});
Deno.test({
name: `
Input: [1, 2]
Output: 1
`,
fn(): void{
constresult: number=findShortestSubArray([1,2]);
asserts.assertEquals(1,result);
},
});
Deno.test({
name: `
Input: [1, 2, 3, 4, 5, 6, 7, 8, 9]
Output: 1
`,
fn(): void{
constresult: number=findShortestSubArray([1,2,3,4,5,6,7,8,9]);
asserts.assertEquals(1,result);
},
});