self-closing-child-strict.js 763 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. require(__dirname).test({
  2. xml :
  3. "<root>"+
  4. "<child>" +
  5. "<haha />" +
  6. "</child>" +
  7. "<monkey>" +
  8. "=(|)" +
  9. "</monkey>" +
  10. "</root>",
  11. expect : [
  12. ["opentag", {
  13. "name": "root",
  14. "attributes": {},
  15. "isSelfClosing": false
  16. }],
  17. ["opentag", {
  18. "name": "child",
  19. "attributes": {},
  20. "isSelfClosing": false
  21. }],
  22. ["opentag", {
  23. "name": "haha",
  24. "attributes": {},
  25. "isSelfClosing": true
  26. }],
  27. ["closetag", "haha"],
  28. ["closetag", "child"],
  29. ["opentag", {
  30. "name": "monkey",
  31. "attributes": {},
  32. "isSelfClosing": false
  33. }],
  34. ["text", "=(|)"],
  35. ["closetag", "monkey"],
  36. ["closetag", "root"],
  37. ["end"],
  38. ["ready"]
  39. ],
  40. strict : true,
  41. opt : {}
  42. });