Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanong committed Oct 16, 2024
1 parent bc2504d commit 1058866
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/html4/test_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def test_exceptions_remove_newlines
refute_empty(errors, "has errors")
errors.each do |error|
assert_equal(error.to_s.chomp, error.to_s)
assert_nil(error.path)
end
end

Expand Down Expand Up @@ -813,6 +814,7 @@ def test_silencing_nonparse_errors_during_attribute_insertion_1262
Nokogiri::HTML4.parse(input, nil, nil, parse_options)
end
assert_match(/Parser without recover option encountered error or warning/, exception.to_s)
assert_nil(exception.path)
end
end

Expand All @@ -835,6 +837,7 @@ def test_silencing_nonparse_errors_during_attribute_insertion_1262
Nokogiri::HTML4.parse(input, nil, "UTF-8", parse_options)
end
assert_match(/Parser without recover option encountered error or warning/, exception.to_s)
assert_nil(exception.path)
end
end

Expand Down
3 changes: 2 additions & 1 deletion test/xml/test_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,10 @@ def test_can_be_closed
let(:parse_options) { xml_strict }

it "raises exception on parse error" do
assert_raises Nokogiri::SyntaxError do
error = assert_raises Nokogiri::SyntaxError do
Nokogiri::XML.parse(input, nil, nil, parse_options)
end
assert_nil(error.path)
end
end

Expand Down

0 comments on commit 1058866

Please sign in to comment.