self-closing-child.js 764 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 : false,
  41. opt : {}
  42. });