diff --git a/spec/validator_spec.js b/spec/validator_spec.js index 1b0319ae..27a25482 100644 --- a/spec/validator_spec.js +++ b/spec/validator_spec.js @@ -323,6 +323,18 @@ describe("XMLParser", function() { expect(result).toBe(true); }); + it("should fail for XML with ! which is not a comment, DOCTYPE or CDATA", function () { + const xmlData = ""; + const expected = { + "code": "InvalidTag", + "msg": "Tag !bla is an invalid name." + }; + + const result = validator.validate(xmlData).err; + //console.log(JSON.stringify(result,null,4)); + expect(result).toEqual(expected); + }); + it("should not validate XML when prolog doesn't start from 1st char", function() { const xmlData = " Hello World."; const expected = {