mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/rexml/test_document.rb
(REXMLTests::TestDocument::EntityExpansionLimitTest): Group tests by general entity and parameter entity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a38971c595
commit
64f9f1ba58
2 changed files with 15 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sat Nov 15 20:46:44 2014 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
|
* test/rexml/test_document.rb
|
||||||
|
(REXMLTests::TestDocument::EntityExpansionLimitTest):
|
||||||
|
Group tests by general entity and parameter entity.
|
||||||
|
|
||||||
Sat Nov 15 20:43:31 2014 Kouhei Sutou <kou@cozmixng.org>
|
Sat Nov 15 20:43:31 2014 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
* test/rexml/test_document.rb
|
* test/rexml/test_document.rb
|
||||||
|
|
|
@ -41,7 +41,8 @@ EOF
|
||||||
REXML::Security.entity_expansion_limit = @default_entity_expansion_limit
|
REXML::Security.entity_expansion_limit = @default_entity_expansion_limit
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_general_entity_have_value
|
class GeneralEntityTest < self
|
||||||
|
def test_have_value
|
||||||
xml = <<EOF
|
xml = <<EOF
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE member [
|
<!DOCTYPE member [
|
||||||
|
@ -71,7 +72,7 @@ EOF
|
||||||
assert_equal(101, doc.entity_expansion_count)
|
assert_equal(101, doc.entity_expansion_count)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_general_entity_empty_value
|
def test_empty_value
|
||||||
xml = <<EOF
|
xml = <<EOF
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE member [
|
<!DOCTYPE member [
|
||||||
|
@ -101,7 +102,7 @@ EOF
|
||||||
assert_equal(101, doc.entity_expansion_count)
|
assert_equal(101, doc.entity_expansion_count)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_general_entity_with_default_entity
|
def test_with_default_entity
|
||||||
xml = <<EOF
|
xml = <<EOF
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE member [
|
<!DOCTYPE member [
|
||||||
|
@ -124,8 +125,10 @@ EOF
|
||||||
doc.root.children.first.value
|
doc.root.children.first.value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_parameter_entity_have_value
|
class ParameterEntityTest < self
|
||||||
|
def test_have_value
|
||||||
xml = <<EOF
|
xml = <<EOF
|
||||||
<!DOCTYPE root [
|
<!DOCTYPE root [
|
||||||
<!ENTITY % a "BOOM.BOOM.BOOM.BOOM.BOOM.BOOM.BOOM.BOOM.BOOM.">
|
<!ENTITY % a "BOOM.BOOM.BOOM.BOOM.BOOM.BOOM.BOOM.BOOM.BOOM.">
|
||||||
|
@ -150,7 +153,7 @@ EOF
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_parameter_entity_empty_value
|
def test_empty_value
|
||||||
xml = <<EOF
|
xml = <<EOF
|
||||||
<!DOCTYPE root [
|
<!DOCTYPE root [
|
||||||
<!ENTITY % a "">
|
<!ENTITY % a "">
|
||||||
|
@ -175,6 +178,7 @@ EOF
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_tag_in_cdata_with_not_ascii_only_but_ascii8bit_encoding_source
|
def test_tag_in_cdata_with_not_ascii_only_but_ascii8bit_encoding_source
|
||||||
tag = "<b>...</b>"
|
tag = "<b>...</b>"
|
||||||
|
|
Loading…
Add table
Reference in a new issue