-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ts
31 lines (29 loc) · 1004 Bytes
/
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 { assertEquals } from "../deps.ts";
import html_Entity_Parser from "./index.ts";
Deno.test("html-entity-parser", () => {
const testData: { input: string; output: string }[] = [
{
input: "& is an HTML entity but &ambassador; is not.",
output: "& is an HTML entity but &ambassador; is not.",
},
{
input: "and I quote: "..."",
output: 'and I quote: "..."',
},
{
input: "Stay home! Practice on Leetcode :)",
output: "Stay home! Practice on Leetcode :)",
},
{
input: "x > y && x < y is always false",
output: "x > y && x < y is always false",
},
{
input: "leetcode.com⁄problemset⁄all",
output: "leetcode.com/problemset/all",
},
];
testData.forEach(function ({ input, output }) {
assertEquals(html_Entity_Parser(input), output);
});
});