diff --git a/vlib/encoding/xml/test/local/12_doctype_entity/entity_expected.xml b/vlib/encoding/xml/test/local/12_doctype_entity/entity_expected.xml new file mode 100644 index 0000000000..09a24cbc61 --- /dev/null +++ b/vlib/encoding/xml/test/local/12_doctype_entity/entity_expected.xml @@ -0,0 +1,9 @@ + + +]> + + + Warning: Something bad happened... please refresh and try again. + + diff --git a/vlib/encoding/xml/test/local/12_doctype_entity/spec_entity_test.v b/vlib/encoding/xml/test/local/12_doctype_entity/spec_entity_test.v index 1327040bd7..9c0fe0c141 100644 --- a/vlib/encoding/xml/test/local/12_doctype_entity/spec_entity_test.v +++ b/vlib/encoding/xml/test/local/12_doctype_entity/spec_entity_test.v @@ -4,38 +4,7 @@ import os import encoding.xml fn test_valid_parsing() { - path := os.join_path(os.dir(@FILE), 'entity.xml') - - mut reverse_entities := xml.default_entities_reverse.clone() - reverse_entities['Warning: Something bad happened... please refresh and try again.'] = 'warning' - - expected := xml.XMLDocument{ - parsed_reverse_entities: reverse_entities - doctype: xml.DocumentType{ - name: 'body' - dtd: xml.DocumentTypeDefinition{ - name: '' - list: [ - xml.DTDEntity{ - name: 'warning' - value: 'Warning: Something bad happened... please refresh and try again.' - }, - ] - } - } - root: xml.XMLNode{ - name: 'body' - children: [ - xml.XMLNode{ - name: 'message' - children: [ - 'Warning: Something bad happened... please refresh and try again.', - ] - }, - ] - } - } - actual := xml.XMLDocument.from_file(path)!.validate()! - + expected := xml.XMLDocument.from_file(os.join_path(os.dir(@FILE), 'entity.xml'))!.validate()! + actual := xml.XMLDocument.from_file(os.join_path(os.dir(@FILE), 'entity_expected.xml'))!.validate()! assert expected == actual, 'Parsed XML document should be equal to expected XML document' }