| 1 | module main |
| 2 | |
| 3 | import os |
| 4 | import encoding.xml |
| 5 | |
| 6 | fn test_valid_parsing() { |
| 7 | // We use a .bin file to avoid stripping the BOM from the XML file |
| 8 | path := os.join_path(os.dir(@FILE), 'workbook.bin') |
| 9 | |
| 10 | doc := xml.XMLDocument.from_file(path) or { |
| 11 | assert false, 'Failed to parse workbook.bin' |
| 12 | exit(1) |
| 13 | } |
| 14 | |
| 15 | sheets := doc.get_elements_by_tag('sheet') |
| 16 | assert sheets.len == 1, 'Expected 1 sheet, got ${sheets.len}' |
| 17 | } |
| 18 |