-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
46 lines (41 loc) · 1.47 KB
/
test.js
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
import assert from 'node:assert/strict'
import test from 'node:test'
import {doctype} from './index.js'
test('doctype(name)', function () {
assert.deepEqual(doctype('foo'), null)
assert.deepEqual(doctype(5), 'html')
assert.deepEqual(doctype('5'), 'html')
assert.deepEqual(doctype('5.0'), 'html')
assert.deepEqual(doctype('HTML5'), 'html')
assert.deepEqual(doctype('HTML 5'), 'html')
assert.deepEqual(doctype('html 5'), 'html')
assert.deepEqual(doctype('html'), 'html')
assert.deepEqual(
doctype(4),
'HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"'
)
assert.deepEqual(
doctype(4.01),
'HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"'
)
assert.deepEqual(
doctype('4.01t'),
'HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"'
)
assert.deepEqual(
doctype('4.01 transitional'),
'HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"'
)
assert.deepEqual(
doctype('4.01Transitional'),
'HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"'
)
assert.deepEqual(
doctype('svg'),
'svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"'
)
assert.deepEqual(
doctype('m'),
'math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"'
)
})