module main import os import encoding.xml fn test_valid_parsing() { path := os.join_path(os.dir(@FILE), 'cdata.xml') expected := xml.XMLDocument{ root: xml.XMLNode{ name: 'sample' children: [ xml.XMLNode{ name: 'html' children: ['This is <b>bold</b>'] }, xml.XMLNode{ name: 'html' children: [xml.XMLCData{ text: 'This is bold' }] }, ] } } actual := xml.XMLDocument.from_file(path)! assert expected == actual, 'Parsed XML document should be equal to expected XML document' }