scratch-vm/test/unit/util_xml.js

10 lines
296 B
JavaScript
Raw Normal View History

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