Skip to content

Commit

Permalink
test: handle upstream libxml2 error message changes (#3109)
Browse files Browse the repository at this point in the history
**What problem is this PR intended to solve?**

Upstream libxml2 (pre-2.13) is changing some error messages. Let's make
the tests more robust around those messages.
  • Loading branch information
flavorjones committed Jan 22, 2024
2 parents 9216c5c + dae4af5 commit 3673f77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/xml/test_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ class TestNokogiriXMLSchema < Nokogiri::TestCase
errors.grep(/ERROR: Attempt to load network entity/).length,
"Should not see xmlIO.c:xmlNoNetExternalEntityLoader() raising XML_IO_NETWORK_ATTEMPT",
)
assert_equal(1, errors.grep(/WARNING: failed to load/).length)
# changed from "WARNING" to "FATAL" in libxml2 2.13
assert_equal(1, errors.grep(/(WARNING|FATAL): failed to load/).length)
end

it "XML::Schema parsing of memory attempts to access external DTDs" do
Expand All @@ -323,7 +324,8 @@ class TestNokogiriXMLSchema < Nokogiri::TestCase
errors.grep(/ERROR: Attempt to load network entity/).length,
"Should not see xmlIO.c:xmlNoNetExternalEntityLoader() raising XML_IO_NETWORK_ATTEMPT",
)
assert_equal(1, errors.grep(/WARNING: failed to load/).length)
# changed from "WARNING" to "FATAL" in libxml2 2.13
assert_equal(1, errors.grep(/(WARNING|FATAL): failed to load/).length)
end
end
end
Expand Down

0 comments on commit 3673f77

Please sign in to comment.