]> git.proxmox.com Git - rustc.git/blob - src/vendor/html5ever/html5lib-tests/serializer/options.test
New upstream version 1.27.1+dfsg1
[rustc.git] / src / vendor / html5ever / html5lib-tests / serializer / options.test
1 {"tests":[
2
3 {"description": "quote_char=\"'\"",
4 "options": {"quote_char": "'"},
5 "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "test 'with' quote_char"}]]],
6 "expected": ["<span title='test &#39;with&#39; quote_char'>"]
7 },
8
9 {"description": "quote_attr_values=true",
10 "options": {"quote_attr_values": true},
11 "input": [["StartTag", "http://www.w3.org/1999/xhtml", "button", [{"namespace": null, "name": "disabled", "value" :"disabled"}]]],
12 "expected": ["<button disabled>"],
13 "xhtml": ["<button disabled=\"disabled\">"]
14 },
15
16 {"description": "quote_attr_values=true with irrelevant",
17 "options": {"quote_attr_values": true},
18 "input": [["StartTag", "http://www.w3.org/1999/xhtml", "div", [{"namespace": null, "name": "irrelevant", "value" :"irrelevant"}]]],
19 "expected": ["<div irrelevant>"],
20 "xhtml": ["<div irrelevant=\"irrelevant\">"]
21 },
22
23 {"description": "use_trailing_solidus=true with void element",
24 "options": {"use_trailing_solidus": true},
25 "input": [["EmptyTag", "img", {}]],
26 "expected": ["<img />"]
27 },
28
29 {"description": "use_trailing_solidus=true with non-void element",
30 "options": {"use_trailing_solidus": true},
31 "input": [["StartTag", "http://www.w3.org/1999/xhtml", "div", {}]],
32 "expected": ["<div>"]
33 },
34
35 {"description": "minimize_boolean_attributes=false",
36 "options": {"minimize_boolean_attributes": false},
37 "input": [["StartTag", "http://www.w3.org/1999/xhtml", "div", [{"namespace": null, "name": "irrelevant", "value" :"irrelevant"}]]],
38 "expected": ["<div irrelevant=irrelevant>"],
39 "xhtml": ["<div irrelevant=\"irrelevant\">"]
40 },
41
42 {"description": "minimize_boolean_attributes=false with empty value",
43 "options": {"minimize_boolean_attributes": false},
44 "input": [["StartTag", "http://www.w3.org/1999/xhtml", "div", [{"namespace": null, "name": "irrelevant", "value" :""}]]],
45 "expected": ["<div irrelevant=\"\">"]
46 },
47
48 {"description": "escape less than signs in attribute values",
49 "options": {"escape_lt_in_attrs": true},
50 "input": [["StartTag", "http://www.w3.org/1999/xhtml", "a", [{"namespace": null, "name": "title", "value": "a<b>c&d"}]]],
51 "expected": ["<a title=\"a&lt;b>c&amp;d\">"]
52 },
53
54 {"description": "rcdata",
55 "options": {"escape_rcdata": true},
56 "input": [["StartTag", "http://www.w3.org/1999/xhtml", "script", {}], ["Characters", "a<b>c&d"]],
57 "expected": ["<script>a&lt;b&gt;c&amp;d"]
58 }
59
60 ]}