Skip to content

Commit

Permalink
test: improve linear performance test names
Browse files Browse the repository at this point in the history
Use "test_linear_performance_XXX" style.
  • Loading branch information
kou committed Jul 16, 2024
1 parent 910e5a2 commit 0e33d3a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/parse/test_attlist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module REXMLTests
class TestParseAttlist < Test::Unit::TestCase
include Test::Unit::CoreAssertions

def test_gt_linear_performance
def test_linear_performance_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<!DOCTYPE schema SYSTEM "foo.dtd" [<!ATTLIST ' + " " * n + ' root v CDATA #FIXED "test">]>')
Expand Down
2 changes: 1 addition & 1 deletion test/parse/test_cdata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module REXMLTests
class TestParseCData < Test::Unit::TestCase
include Test::Unit::CoreAssertions

def test_gt_linear_performance
def test_linear_performance_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<description><![CDATA[ ' + ">" * n + ' ]]></description>')
Expand Down
2 changes: 1 addition & 1 deletion test/parse/test_character_reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module REXMLTests
class TestParseCharacterReference < Test::Unit::TestCase
include Test::Unit::CoreAssertions

def test_gt_linear_performance_many_preceding_zeros
def test_linear_performance_many_preceding_zeros
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<test testing="&#' + "0" * n + '97;"/>')
Expand Down
4 changes: 2 additions & 2 deletions test/parse/test_comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ def test_after_root
assert_equal(" ok comment ", events[:comment])
end

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

def test_gt_linear_performance_in_element
def test_linear_performance_in_element_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<xml><!-- ' + '>' * n + ' --></xml>')
Expand Down
4 changes: 2 additions & 2 deletions test/parse/test_document_type_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_notation_attlist
doctype.children.collect(&:class))
end

def test_gt_linear_performance_malformed_entity
def test_linear_performance_percent_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
begin
Expand All @@ -290,7 +290,7 @@ def test_gt_linear_performance_malformed_entity
end
end

def test_gt_linear_performance_comment
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 + ' -->]>')
Expand Down
2 changes: 1 addition & 1 deletion test/parse/test_element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_after_empty_element_tag_root
end
end

def test_gt_linear_performance_attribute_value
def test_linear_performance_attribute_value_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<test testing="' + ">" * n + '"></test>')
Expand Down
2 changes: 1 addition & 1 deletion test/parse/test_entity_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_empty
DETAIL
end

def test_gt_linear_performance
def test_linear_performance_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 + '">')
Expand Down
2 changes: 1 addition & 1 deletion test/parse/test_processing_instruction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_after_root
assert_equal("abc", events[:processing_instruction])
end

def test_gt_linear_performance
def test_linear_performance_gt
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<?xml version="1.0" ' + ">" * n + ' ?>')
Expand Down

0 comments on commit 0e33d3a

Please sign in to comment.