Skip to content

Commit 26a181c

Browse files
committed
test xml construction
1 parent ad061d4 commit 26a181c

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

run_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests = ["parse"]
1+
tests = ["parse", "create"]
22

33
for t in tests
44
fpath = joinpath("test", "$t.jl")

test/create.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ xs2 = new_child(xroot, "State")
1212
add_text(xs2, "Illinois")
1313
set_attribute(xs2, "tag", "MA")
1414

15-
show(xdoc)
16-
17-
show(xroot)
18-
19-
# save_file(xdoc, "tt.xml")
15+
rtxt = """
16+
<?xml version="1.0" encoding="utf-8"?>
17+
<States>
18+
<State tag="MA">Massachusetts</State>
19+
<State tag="MA">Illinois</State>
20+
</States>
21+
"""
22+
23+
@assert strip(string(xdoc)) == strip(rtxt)
2024

2125
free(xdoc)

test/dump.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using MiniXML
33
# document
44

55
docstr = """
6-
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
6+
<?xml version="1.0" encoding="UTF-8"?>
77
<bookstore>
88
<book category="COOKING" tag="first">
99
<title lang="en">Everyday Italian</title>

test/parse.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using Base.Test
44
# document
55

66
docstr = """
7-
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
7+
<?xml version="1.0" encoding="UTF-8"?>
88
<bookstore>
99
<book category="COOKING" tag="first">
1010
<title lang="en">Everyday Italian</title>

0 commit comments

Comments
 (0)