diff options
author | Rupinder Singh Khokhar <rsk1coder99@gmail.com> | 2014-06-11 09:13:22 +0530 |
---|---|---|
committer | Rupinder Singh Khokhar <rsk1coder99@gmail.com> | 2014-06-11 09:17:12 +0530 |
commit | 42543b07806ca9b9bec73eda91afa657f57c64bc (patch) | |
tree | b08ae0c9371865989ab6a9abb025346a3dbd1204 /test/data/serializer/options.test | |
parent | 7630ae893aad7fbb168d073f405cfa2110ccb530 (diff) | |
download | libhubbub-42543b07806ca9b9bec73eda91afa657f57c64bc.tar.gz libhubbub-42543b07806ca9b9bec73eda91afa657f57c64bc.tar.bz2 |
Adding the latest test files without fixing the INDEXes or the test interfacesrupindersingh/test
Diffstat (limited to 'test/data/serializer/options.test')
-rw-r--r-- | test/data/serializer/options.test | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/data/serializer/options.test b/test/data/serializer/options.test new file mode 100644 index 0000000..6f342dd --- /dev/null +++ b/test/data/serializer/options.test @@ -0,0 +1,60 @@ +{"tests":[ + +{"description": "quote_char=\"'\"", + "options": {"quote_char": "'"}, + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "test 'with' quote_char"}]]], + "expected": ["<span title='test 'with' quote_char'>"] +}, + +{"description": "quote_attr_values=true", + "options": {"quote_attr_values": true}, + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "button", [{"namespace": null, "name": "disabled", "value" :"disabled"}]]], + "expected": ["<button disabled>"], + "xhtml": ["<button disabled=\"disabled\">"] +}, + +{"description": "quote_attr_values=true with irrelevant", + "options": {"quote_attr_values": true}, + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "div", [{"namespace": null, "name": "irrelevant", "value" :"irrelevant"}]]], + "expected": ["<div irrelevant>"], + "xhtml": ["<div irrelevant=\"irrelevant\">"] +}, + +{"description": "use_trailing_solidus=true with void element", + "options": {"use_trailing_solidus": true}, + "input": [["EmptyTag", "img", {}]], + "expected": ["<img />"] +}, + +{"description": "use_trailing_solidus=true with non-void element", + "options": {"use_trailing_solidus": true}, + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "div", {}]], + "expected": ["<div>"] +}, + +{"description": "minimize_boolean_attributes=false", + "options": {"minimize_boolean_attributes": false}, + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "div", [{"namespace": null, "name": "irrelevant", "value" :"irrelevant"}]]], + "expected": ["<div irrelevant=irrelevant>"], + "xhtml": ["<div irrelevant=\"irrelevant\">"] +}, + +{"description": "minimize_boolean_attributes=false with empty value", + "options": {"minimize_boolean_attributes": false}, + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "div", [{"namespace": null, "name": "irrelevant", "value" :""}]]], + "expected": ["<div irrelevant=\"\">"] +}, + +{"description": "escape less than signs in attribute values", + "options": {"escape_lt_in_attrs": true}, + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "a", [{"namespace": null, "name": "title", "value": "a<b>c&d"}]]], + "expected": ["<a title=\"a<b>c&d\">"] +}, + +{"description": "rcdata", + "options": {"escape_rcdata": true}, + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "script", {}], ["Characters", "a<b>c&d"]], + "expected": ["<script>a<b>c&d"] +} + +]} |