Skip to content

Commit

Permalink
test: fix location
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 1, 2024
1 parent 6cac15d commit 11dc1b1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/parse/test_document_type_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,23 +280,6 @@ def test_notation_attlist
doctype.children.collect(&:class))
end

def test_linear_performance_percent_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
begin
REXML::Document.new('<!DOCTYPE root [' + "%>" * n + ']><test/>')
rescue
end
end
end

def test_linear_performance_comment_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<!DOCTYPE root [<!-- ' + ">" * n + ' -->]>')
end
end

private
def parse(internal_subset)
super(<<-DOCTYPE)
Expand All @@ -306,5 +289,22 @@ def parse(internal_subset)
DOCTYPE
end
end

def test_linear_performance_percent_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
begin
REXML::Document.new('<!DOCTYPE root [' + "%>" * n + ']><test/>')
rescue
end
end
end

def test_linear_performance_comment_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<!DOCTYPE root [<!-- ' + ">" * n + ' -->]>')
end
end
end
end

0 comments on commit 11dc1b1

Please sign in to comment.