|
1 | 1 | import { assert } from "../deps.ts";
|
2 |
| -import entityParser from "./index.ts"; |
| 2 | +import { htmlEntityParser } from "../mod.ts"; |
3 | 3 |
|
4 | 4 | Deno.test("html-entity-parser", () => {
|
5 |
| - const testData: { input: string; output: string }[] = [ |
6 |
| - { |
7 |
| - input: "& is an HTML entity but &ambassador; is not.", |
8 |
| - output: "& is an HTML entity but &ambassador; is not.", |
9 |
| - }, |
10 |
| - { |
11 |
| - input: "and I quote: "..."", |
12 |
| - output: 'and I quote: "..."', |
13 |
| - }, |
14 |
| - { |
15 |
| - input: "Stay home! Practice on Leetcode :)", |
16 |
| - output: "Stay home! Practice on Leetcode :)", |
17 |
| - }, |
18 |
| - { |
19 |
| - input: "x > y && x < y is always false", |
20 |
| - output: "x > y && x < y is always false", |
21 |
| - }, |
22 |
| - { |
23 |
| - input: "leetcode.com⁄problemset⁄all", |
24 |
| - output: "leetcode.com/problemset/all", |
25 |
| - }, |
26 |
| - ]; |
| 5 | + const testData: { input: string; output: string }[] = [ |
| 6 | + { |
| 7 | + input: "& is an HTML entity but &ambassador; is not.", |
| 8 | + output: "& is an HTML entity but &ambassador; is not.", |
| 9 | + }, |
| 10 | + { |
| 11 | + input: "and I quote: "..."", |
| 12 | + output: 'and I quote: "..."', |
| 13 | + }, |
| 14 | + { |
| 15 | + input: "Stay home! Practice on Leetcode :)", |
| 16 | + output: "Stay home! Practice on Leetcode :)", |
| 17 | + }, |
| 18 | + { |
| 19 | + input: "x > y && x < y is always false", |
| 20 | + output: "x > y && x < y is always false", |
| 21 | + }, |
| 22 | + { |
| 23 | + input: "leetcode.com⁄problemset⁄all", |
| 24 | + output: "leetcode.com/problemset/all", |
| 25 | + }, |
| 26 | + ]; |
27 | 27 |
|
28 |
| - assert( |
29 |
| - testData.every(({ input, output }) => entityParser(input) === output), |
30 |
| - ); |
| 28 | + assert( |
| 29 | + testData.every( |
| 30 | + ({ input, output }) => htmlEntityParser(input) === output, |
| 31 | + ), |
| 32 | + ); |
31 | 33 | });
|
0 commit comments