File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -182,12 +182,18 @@ def error(msg)
182
182
183
183
it :test_broken_encoding do
184
184
skip_unless_libxml2 ( "ultra hard to fix for pure Java version" )
185
+
185
186
parser . options |= Nokogiri ::XML ::ParseOptions ::RECOVER
186
187
# This is ISO_8859-1:
187
188
parser << "<?xml version='1.0' encoding='UTF-8'?><r>Gau\337 </r>"
188
189
parser . finish
190
+
189
191
assert_operator ( parser . document . errors . size , :>= , 1 )
190
- assert_equal "Gau\337 " , parser . document . data . join
192
+
193
+ # the interpretation of the byte may vary by libxml2 version in recovery mode
194
+ # see for example https://gitlab.gnome.org/GNOME/libxml2/-/issues/598
195
+ assert ( parser . document . data . join . start_with? ( "Gau" ) )
196
+
191
197
assert_equal [ [ "r" ] ] , parser . document . end_elements
192
198
end
193
199
You can’t perform that action at this time.
0 commit comments