scratch-vm/test/unit/util_xml.js

10 lines
296 B
JavaScript
Raw Normal View History

var test = require('tap').test;
var xml = require('../../src/util/xml-escape');
test('escape', function (t) {
var input = '<foo bar="he & llo \'"></foo>';
var output = '&lt;foo bar=&quot;he &amp; llo &apos;&quot;&gt;&lt;/foo&gt;';
t.strictEqual(xml(input), output);
t.end();
});