Skip to content

Commit 46c6397

Browse files
Watson1978kou
authored andcommitted
test: add performance tests for entity declaration
1 parent 29027c9 commit 46c6397

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

test/parse/test_entity_declaration.rb

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,39 @@ def test_empty
518518
DETAIL
519519
end
520520

521-
def test_linear_performance_gt
521+
def test_linear_performance_entity_value_gt
522522
seq = [10000, 50000, 100000, 150000, 200000]
523523
assert_linear_performance(seq, rehearsal: 10) do |n|
524-
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version \"" + ">" * n + "\">]>")
524+
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version \"" +
525+
">" * n +
526+
"\">]>")
527+
end
528+
end
529+
530+
def test_linear_performance_entity_value_gt_right_bracket
531+
seq = [10000, 50000, 100000, 150000, 200000]
532+
assert_linear_performance(seq, rehearsal: 10) do |n|
533+
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version \"" +
534+
">]" * n +
535+
"\">]>")
536+
end
537+
end
538+
539+
def test_linear_performance_system_literal_in_system_gt_right_bracket
540+
seq = [10000, 50000, 100000, 150000, 200000]
541+
assert_linear_performance(seq, rehearsal: 10) do |n|
542+
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version SYSTEM \"" +
543+
">]" * n +
544+
"\">]>")
545+
end
546+
end
547+
548+
def test_linear_performance_system_literal_in_public_gt_right_bracket
549+
seq = [10000, 50000, 100000, 150000, 200000]
550+
assert_linear_performance(seq, rehearsal: 10) do |n|
551+
REXML::Document.new("<!DOCTYPE rubynet [<!ENTITY rbconfig.ruby_version PUBLIC \"pubid-literal\" \"" +
552+
">]" * n +
553+
"\">]>")
525554
end
526555
end
527556
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy