v / vlib / encoding / xml / test / local / 05_single_element / root_test.v
18 lines · 15 sloc · 375 bytes · c51d30bf5309653c6b573ec815268e69a78ea8cc
Raw
1import os
2import encoding.xml
3
4fn 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