Skip to content

Commit af39977

Browse files
authored
Bump XML2_jll compat and bump version to 1.2.2 (#213)
* Bump XML2_jll compat to 2.14 * improve test coverage of warnings * fix spacing
1 parent 3bc8fc2 commit af39977

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name = "EzXML"
22
uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
33
authors = ["Kenta Sato <[email protected]>"]
4-
version = "1.2.1"
4+
version = "1.2.2"
55

66
[deps]
77
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
88
XML2_jll = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
99

1010
[compat]
1111
Printf = "1.3"
12-
XML2_jll = "2.9.9 - 2.13"
12+
XML2_jll = "2.9.9 - 2.14"
1313
julia = "1.6"

test/runtests.jl

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ end
114114
end
115115
@test isa(doc, EzXML.Document)
116116
@test nodetype(doc.node) === EzXML.HTML_DOCUMENT_NODE
117-
@test occursin("Warning: XMLError: htmlParseCharRef: missing semicolon from HTML parser (code: 7, line: 2)", messages)
118-
@test occursin("Warning: XMLError: htmlParseCharRef: missing semicolon from HTML parser (code: 7, line: 4)", messages)
117+
# in XML2_jll v2.14 "Several non-standard syntax warnings were removed."
118+
# https://github.com/GNOME/libxml2/blob/v2.14.4/NEWS#L90
119+
# @test occursin("Warning: XMLError: htmlParseCharRef: missing semicolon from HTML parser (code: 7, line: 2)", messages)
120+
# @test occursin("Warning: XMLError: htmlParseCharRef: missing semicolon from HTML parser (code: 7, line: 4)", messages)
119121
end
120122
end
121123

@@ -190,6 +192,19 @@ end
190192
@test_throws EzXML.XMLError parsexml("<gepa?>jgo<<<><<")
191193
end
192194
@test occursin("errors; throwing the first one", messages)
195+
196+
# This is to test warnings are logged properly
197+
doc, messages = capture_logging_messages() do
198+
parsexml("""
199+
<?xml version="1.0"?>
200+
<root xmlns:ns="http://example.com">
201+
<ns:element>
202+
<undeclared:child>content</undeclared:child>
203+
</ns:element>
204+
</root>
205+
""")
206+
end
207+
@test !isempty(messages)
193208
end
194209

195210
@testset "HTML" begin

0 commit comments

Comments
 (0)