deno.land / x / masx200_leetcode_test@10.6.5 / design-compressed-string-iterator / 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
import StringIterator from "./index.ts";import { assertEquals } from "https://deno.land/std@0.157.0/testing/asserts.ts";Deno.test("design-compressed-string-iterator", () => { const iterator = new StringIterator("L1e2t1C1o1d1e1"); const res: any[] = []; res.push(iterator.next()); // 'L' res.push(iterator.next()); // 'e' res.push(iterator.next()); // 'e' res.push(iterator.next()); // 't' res.push(iterator.next()); // 'C' res.push(iterator.next()); // 'o' res.push(iterator.next()); // 'd' res.push(iterator.hasNext()); // true res.push(iterator.next()); // 'e' res.push(iterator.hasNext()); // false res.push(iterator.next()); // ' ' assertEquals(res, [ "L", "e", "e", "t", "C", "o", "d", true, "e", false, "", ]);});
masx200_leetcode_test

Version Info

Tagged at
2 years ago