Skip to content

Commit 347eacb

Browse files
authored
Merge pull request #2852 from sparklemotion/flavorjones-libxml2-2.10.4-backport
dep: update to libxml2 2.10.4 (backport)
2 parents 1580121 + 36b0b33 commit 347eacb

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ bundle exec rake compile test:memcheck
170170
```
171171

172172

173-
Note that by default the test suite will run a major GC after each test completes. This has shown to be useful for localizing some classes of memory bugs, but does slow the suite down. Some variations of the test suite behavior are available (see `test/helper.rb` for more info):
173+
Note that by you can run the test suite with a variety of GC behaviors. For example, running a major after each test completes has, on occasion, been useful for localizing some classes of memory bugs, but does slow the suite down. Some variations of the test suite behavior are available (see `test/helper.rb` for more info):
174174

175175
``` sh
176176
# see failure messages immediately

dependencies.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
libxml2:
2-
version: "2.10.3"
3-
sha256: "5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c"
4-
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.10/libxml2-2.10.3.sha256sum
2+
version: "2.10.4"
3+
sha256: "ed0c91c5845008f1936739e4eee2035531c1c94742c6541f44ee66d885948d45"
4+
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.10/libxml2-2.10.4.sha256sum
55

66
libxslt:
77
version: "1.1.37"

test/helper.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# Some environment variables that are used to configure the test suite:
55
# - NOKOGIRI_TEST_FAIL_FAST: if set to anything, emit test failure messages immediately upon failure
66
# - NOKOGIRI_TEST_GC_LEVEL: (roughly in order of stress)
7-
# - "normal" - normal GC functionality
7+
# - "normal" - normal GC functionality (default)
88
# - "minor" - force a minor GC cycle after each test
9-
# - "major" (default for Rubies without compaction) - force a major GC cycle after each test
10-
# - "compact" (default for Rubies with compaction) - force a major GC after each test and GC compaction after every 20 tests
9+
# - "major" - force a major GC cycle after each test
10+
# - "compact" - force a major GC after each test and GC compaction after every 20 tests
1111
# - "verify" - force a major GC after each test and verify references-after-compaction after every 20 tests
1212
# - "stress" - run tests with GC.stress set to true
1313
# - NOKOGIRI_GC: read more in test/test_memory_leak.rb
@@ -144,12 +144,8 @@ def initialize_nokogiri_test_gc_level
144144
"compact"
145145
elsif (ENV["NOKOGIRI_TEST_GC_LEVEL"] == "verify") && defined?(GC.verify_compaction_references)
146146
"verify"
147-
elsif RUBY_ENGINE == "truffleruby"
148-
"normal"
149-
elsif defined?(GC.compact)
150-
"compact"
151147
else
152-
"major"
148+
"normal"
153149
end
154150

155151
if ["compact", "verify"].include?(@@gc_level)

test/xml/test_node.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,17 +1141,17 @@ def test_namespace_without_an_href_on_html_node
11411141
node = html.at("div").children.first
11421142
refute_nil(node)
11431143

1144-
if Nokogiri.uses_libxml?(">= 2.9.12")
1144+
if Nokogiri.uses_libxml?(">= 2.10.4") || Nokogiri.jruby?
1145+
assert_empty(node.namespaces.keys)
1146+
assert_equal("<o:p>foo</o:p>", node.to_html)
1147+
elsif Nokogiri.uses_libxml?(">= 2.9.12")
11451148
assert_empty(node.namespaces.keys)
11461149
assert_equal("<p>foo</p>", node.to_html)
11471150
elsif Nokogiri.uses_libxml?
11481151
assert_equal(1, node.namespaces.keys.size)
11491152
assert(node.namespaces.key?("xmlns:o"))
11501153
assert_nil(node.namespaces["xmlns:o"])
11511154
assert_equal("<p>foo</p>", node.to_html)
1152-
else # jruby
1153-
assert_empty(node.namespaces.keys)
1154-
assert_equal("<o:p>foo</o:p>", node.to_html)
11551155
end
11561156
end
11571157

0 commit comments

Comments
 (0)