This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

22 lines
680 B
JavaScript
Raw Permalink Normal View History

2021-04-02 02:24:13 +03:00
var XmlDocument = require('../').XmlDocument
var t = require('tap')
t.test('parsing comments outside XML scope [#27]', function (t) {
var xmlString = '<hello>world</hello>\n<!--Thank you for your business!-->';
var parsed = new XmlDocument(xmlString);
// verify that the trailing comment is ignored (no sensible place to put it)
t.equal(parsed.toString(), '<hello>world</hello>');
t.end();
})
t.test('validating escaping of &lt; &gt; [#29]', function (t) {
var xmlString = '<root><command>&lt; &gt;</command></root>';
var parsed = new XmlDocument(xmlString);
var result = parsed.toString({compressed:true})
t.equal(result, xmlString);
t.end();
})