Skip to content

Commit 833432b

Browse files
committed
Merge pull request fb55#37 from eonlepapillon/Add-test-for-Issue-#36
Add a new test for issue fb55#36
2 parents 5e6fcb3 + 7be1360 commit 833432b

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

tests/Documents/Attributes.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Attributes test</title>
5+
</head>
6+
<body>
7+
<!-- Normal attributes -->
8+
<button id="test0" class="value0" title="value1">class="value0" title="value1"</button>
9+
10+
<!-- Attributes with no quotes or value -->
11+
<button id="test1" class=value2 disabled>class=value2 disabled</button>
12+
13+
<!-- Attributes with no space between them. No valid, but accepted by the browser -->
14+
<button id="test2" class="value4"title="value5">class="value4"title="value5"</button>
15+
</body>
16+
</html>

tests/Events/09-attributes.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"name": "attributes (no white space, no value, no quotes)",
3+
"options": {
4+
"handler": {},
5+
"parser": {}
6+
},
7+
"html": "<button class=\"test0\"title=\"test1\" disabled value=test2>adsf</button>",
8+
"expected": [
9+
{
10+
"event": "opentagname",
11+
"data": [
12+
"button"
13+
]
14+
},
15+
{
16+
"event": "opentag",
17+
"data": [
18+
"button",
19+
{
20+
"class": "test0",
21+
"title": "test1",
22+
"disabled": "",
23+
"value": "test2"
24+
}
25+
]
26+
},
27+
{
28+
"event": "attribute",
29+
"data": [
30+
"class",
31+
"test0"
32+
]
33+
},
34+
{
35+
"event": "attribute",
36+
"data": [
37+
"title",
38+
"test1"
39+
]
40+
},
41+
{
42+
"event": "attribute",
43+
"data": [
44+
"disabled",
45+
""
46+
]
47+
},
48+
{
49+
"event": "attribute",
50+
"data": [
51+
"value",
52+
"test2"
53+
]
54+
},
55+
{
56+
"event": "text",
57+
"data": [
58+
"adsf"
59+
]
60+
},
61+
{
62+
"event": "closetag",
63+
"data": [
64+
"button"
65+
]
66+
}
67+
]
68+
}

0 commit comments

Comments
 (0)