Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 46c6397

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

File tree

Expand file treeCollapse file tree

1 file changed

+31
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+31
-2
lines changed

‎test/parse/test_entity_declaration.rb

Copy file name to clipboardExpand all lines: test/parse/test_entity_declaration.rb
+31-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.