aboutsummaryrefslogtreecommitdiff
path: root/node_modules/sax/test/self-closing-child-strict.js
blob: 3d6e98520d8f90ff856272ddb2b536a8ce476daf (plain)
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

require(__dirname).test({
  xml :
  "<root>"+
    "<child>" +
      "<haha />" +
    "</child>" +
    "<monkey>" +
      "=(|)" +
    "</monkey>" +
  "</root>",
  expect : [
    ["opentag", {
     "name": "root",
     "attributes": {},
     "isSelfClosing": false
    }],
    ["opentag", {
     "name": "child",
     "attributes": {},
     "isSelfClosing": false
    }],
    ["opentag", {
     "name": "haha",
     "attributes": {},
     "isSelfClosing": true
    }],
    ["closetag", "haha"],
    ["closetag", "child"],
    ["opentag", {
     "name": "monkey",
     "attributes": {},
     "isSelfClosing": false
    }],
    ["text", "=(|)"],
    ["closetag", "monkey"],
    ["closetag", "root"],
    ["end"],
    ["ready"]
  ],
  strict : true,
  opt : {}
});