Skip to content

Commit

Permalink
test: add performance tests for entity declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 authored and kou committed Aug 1, 2024
1 parent 29027c9 commit 46c6397
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions test/parse/test_entity_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,39 @@ def test_empty
DETAIL
end

def test_linear_performance_gt
def test_linear_performance_entity_value_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version \"" + ">" * n + "\">]>")
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version \"" +
">" * n +
"\">]>")
end
end

def test_linear_performance_entity_value_gt_right_bracket
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version \"" +
">]" * n +
"\">]>")
end
end

def test_linear_performance_system_literal_in_system_gt_right_bracket
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version SYSTEM \"" +
">]" * n +
"\">]>")
end
end

def test_linear_performance_system_literal_in_public_gt_right_bracket
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version PUBLIC \"pubid-literal\" \"" +
">]" * n +
"\">]>")
end
end
end
Expand Down

0 comments on commit 46c6397

Please sign in to comment.