From 06e0f3efa549b0e286699c3b2e8f2928813f4e63 Mon Sep 17 00:00:00 2001 From: Ryan Ong Date: Fri, 18 Oct 2024 13:24:47 -0400 Subject: [PATCH] fix test for java --- test/xml/test_schema.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/xml/test_schema.rb b/test/xml/test_schema.rb index 44ae0732ef1..f242de6b84e 100644 --- a/test/xml/test_schema.rb +++ b/test/xml/test_schema.rb @@ -159,10 +159,17 @@ class TestNokogiriXMLSchema < Nokogiri::TestCase assert(errors = xsd.validate(doc)) assert_equal(2, errors.length) - assert_equal( - ["/purchaseOrder/billTo/state", "/purchaseOrder/shipTo/state"], - errors.map(&:path).sort, - ) + if Nokogiri.uses_libxml? + assert_equal( + ["/purchaseOrder/billTo/state", "/purchaseOrder/shipTo/state"], + errors.map(&:path).sort, + ) + else + assert_equal( + [nil, nil], + errors.map(&:path).sort, + ) + end end it "validate_invalid_file" do