Skip to content

Commit

Permalink
Julia v0.5 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Apr 19, 2016
1 parent d7b63d0 commit 1c577d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using XMLDict
using Base.Test
using JSON

using Compat.readstring
using Compat.write

function xdict(xml)
for (n,v) in xml_dict(xml; strip_text=true)
Expand Down Expand Up @@ -426,14 +428,14 @@ xml9 = """
</table>
"""

xml10 = readall("REC-xml-20081126.xml")
xml10 = readstring("REC-xml-20081126.xml")

function normalise_xml(xml)
o,i,p = readandwrite(
`bash -c 'xmllint --noent --format --nocdata - | sed s/\ xmlns=\".*\"//g' `)
write(i, xml)
close(i)
readall(o)
readstring(o)
end


Expand All @@ -446,8 +448,8 @@ for xml in [xml1, xml2, xml3, xml4, xml5, xml6, xml7, xml8, xml9, xml10]

json_dump(xml_dict(xml))

open("/tmp/a", "w") do f write(f, normalise_xml(xml)) end
open("/tmp/b", "w") do f write(f, normalise_xml(XMLDict.dict_xml(xml_dict(xml)))) end
write("/tmp/a", normalise_xml(xml))
write("/tmp/b", normalise_xml(XMLDict.dict_xml(xml_dict(xml))))
run(`opendiff /tmp/a /tmp/b`)
end

Expand Down

0 comments on commit 1c577d3

Please sign in to comment.