Skip to content

Commit

Permalink
test: move an attribute value test to parse/test_element.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jul 10, 2024
1 parent ebc3e85 commit b2ec329
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 11 additions & 0 deletions test/parse/test_element.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
require "test/unit"
require "core_assertions"

require "rexml/document"

module REXMLTests
class TestParseElement < Test::Unit::TestCase
include Test::Unit::CoreAssertions

def parse(xml)
REXML::Document.new(xml)
end
Expand Down Expand Up @@ -120,5 +124,12 @@ def test_after_empty_element_tag_root
DETAIL
end
end

def test_gt_linear_performance_attribute_value
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<test testing="' + ">" * n + '"></test>')
end
end
end
end
11 changes: 0 additions & 11 deletions test/test_document.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: false

require 'core_assertions'

module REXMLTests
class TestDocument < Test::Unit::TestCase
include Test::Unit::CoreAssertions

def test_version_attributes_to_s
doc = REXML::Document.new(<<~eoxml)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Expand Down Expand Up @@ -202,13 +198,6 @@ def test_xml_declaration_standalone
assert_equal('no', doc.stand_alone?, bug2539)
end

def test_gt_linear_performance_attribute_value
seq = [10000, 50000, 100000, 150000, 200000]
assert_linear_performance(seq, rehearsal: 10) do |n|
REXML::Document.new('<test testing="' + ">" * n + '"></test>')
end
end

def test_each_recursive
xml_source = <<~XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Expand Down

0 comments on commit b2ec329

Please sign in to comment.