- Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.test.ts
49 lines (44 loc) · 1003 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{lengthOfLongestSubstring}from"./index.ts";
log.info("0003 Longest Substring Without Repeating Characters");
Deno.test({
name: `
Input: "abcabcbb"
Output: 3
`,
fn(): void{
constresult=lengthOfLongestSubstring("abcabcbb");
asserts.assertEquals(3,result);
},
});
Deno.test({
name: `
Input: "bbbbb"
Output: 1
`,
fn(): void{
constresult=lengthOfLongestSubstring("bbbbb");
asserts.assertEquals(1,result);
},
});
Deno.test({
name: `
Input: "pwwkew"
Output: 3
`,
fn(): void{
constresult=lengthOfLongestSubstring("pwwkew");
asserts.assertEquals(3,result);
},
});
Deno.test({
name: `
Input: "abcdefghijklmnopqrstuvwxyz"
Output: 26
`,
fn(): void{
constresult=lengthOfLongestSubstring("abcdefghijklmnopqrstuvwxyz");
asserts.assertEquals(26,result);
},
});