scratch-vm/test/unit/util_xml.js
2016-10-03 18:23:43 -04:00

9 lines
296 B
JavaScript

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();
});