Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevecheckoway committed Jan 16, 2024
1 parent de6bcd2 commit 2e26a72
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_memory_usage.rb
Expand Up @@ -301,5 +301,15 @@ def start_element(name, attrs = [])
Nokogiri::HTML5::Document.parse(html)
end
end

it "libgumbo max depth exceeded" do
html = "<html><body>"

memwatch(__method__) do
Nokogiri::HTML5.parse(html, max_tree_depth: 1)
rescue ArgumentError
# Expected error. This comment makes rubocop happy.
end
end
end if ENV["NOKOGIRI_MEMORY_SUITE"] && Nokogiri.uses_libxml?
end

0 comments on commit 2e26a72

Please sign in to comment.