spec/util_xml_spec.lua
changeset 12274 c78639ee6ccb
parent 12184 53e0ae770917
equal deleted inserted replaced
12273:a19d435dee90 12274:c78639ee6ccb
    40 			local x = "<foo><?php die(); ?></foo>";
    40 			local x = "<foo><?php die(); ?></foo>";
    41 			local ok = xml.parse(x);
    41 			local ok = xml.parse(x);
    42 			assert.falsy(ok);
    42 			assert.falsy(ok);
    43 		end);
    43 		end);
    44 
    44 
       
    45 		it("should allow processing instructions if asked nicely", function()
       
    46 			local x = "<?xml-stylesheet href='make-fancy.xsl'?><foo/>";
       
    47 			local stanza = xml.parse(x, {allow_processing_instructions = true});
       
    48 			assert.truthy(stanza);
       
    49 			assert.are.equal(stanza.name, "foo");
       
    50 		end);
       
    51 
    45 		it("should allow an xml declaration", function()
    52 		it("should allow an xml declaration", function()
    46 			local x = "<?xml version='1.0'?><foo/>";
    53 			local x = "<?xml version='1.0'?><foo/>";
    47 			local stanza = xml.parse(x);
    54 			local stanza = xml.parse(x);
    48 			assert.truthy(stanza);
    55 			assert.truthy(stanza);
    49 			assert.are.equal(stanza.name, "foo");
    56 			assert.are.equal(stanza.name, "foo");