| 1 | import os |
| 2 | import encoding.xml |
| 3 | |
| 4 | fn test_valid_parsing() ! { |
| 5 | path := os.join_path(os.dir(@FILE), 'root.xml') |
| 6 | |
| 7 | expected := xml.XMLDocument{ |
| 8 | root: xml.XMLNode{ |
| 9 | name: 'sample' |
| 10 | children: [ |
| 11 | 'Single root element.', |
| 12 | ] |
| 13 | } |
| 14 | } |
| 15 | actual := xml.XMLDocument.from_file(path)! |
| 16 | |
| 17 | assert expected == actual, 'Parsed XML document should be equal to expected XML document' |
| 18 | } |
| 19 |