wallet-core/node_modules/sax/test/issue-49.js
2016-11-03 01:33:53 +01:00

32 lines
1008 B
JavaScript

// https://github.com/isaacs/sax-js/issues/49
require(__dirname).test
( { xml : "<xml><script>hello world</script></xml>"
, expect :
[ [ "opentag", { name: "xml", attributes: {}, isSelfClosing: false } ]
, [ "opentag", { name: "script", attributes: {}, isSelfClosing: false } ]
, [ "text", "hello world" ]
, [ "closetag", "script" ]
, [ "closetag", "xml" ]
]
, strict : false
, opt : { lowercasetags: true, noscript: true }
}
)
require(__dirname).test
( { xml : "<xml><script><![CDATA[hello world]]></script></xml>"
, expect :
[ [ "opentag", { name: "xml", attributes: {}, isSelfClosing: false } ]
, [ "opentag", { name: "script", attributes: {}, isSelfClosing: false } ]
, [ "opencdata", undefined ]
, [ "cdata", "hello world" ]
, [ "closecdata", undefined ]
, [ "closetag", "script" ]
, [ "closetag", "xml" ]
]
, strict : false
, opt : { lowercasetags: true, noscript: true }
}
)