test: update empty xml parse error case in domparser.html

This commit is contained in:
sjhddh
2026-03-15 07:12:10 +00:00
parent 3013e3a9e6
commit 56d3cf51e8

View File

@@ -11,9 +11,9 @@
}
{
// Empty XML is a parse error (no root element)
const parser = new DOMParser();
testing.expectError('Error', () => parser.parseFromString('', 'text/xml'));
let d = parser.parseFromString('', 'text/xml');
testing.expectEqual('<parsererror>error</parsererror>', new XMLSerializer().serializeToString(d));
}
}
</script>