Skip to content

Commit

Permalink
Replace " to '
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Jul 24, 2024
1 parent 8b245cb commit 556487b
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions test/parse/test_entity_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TestGeneralEntityDeclaration < self
class TestName < self
def test_prohibited_character
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY invalid&name "valid-entity-value">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY invalid&name \"valid-entity-value\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -48,7 +48,7 @@ class TestEntityDefinition < self
class TestEntityValue < self
def test_no_quote
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name invalid-entity-value>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name invalid-entity-value>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -61,7 +61,7 @@ def test_no_quote

def test_prohibited_character
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name "% &">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name \"% &\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -74,7 +74,7 @@ def test_prohibited_character

def test_mixed_quote
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name "invalid-entity-value\'>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name \"invalid-entity-value'>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -92,7 +92,7 @@ class TestExternalID < self
class TestSystemLiteral < self
def test_no_quote_in_system
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name SYSTEM invalid-system-literal>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name SYSTEM invalid-system-literal>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -105,7 +105,7 @@ def test_no_quote_in_system

def test_no_quote_in_public
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name PUBLIC "valid-pubid-literal" invalid-system-literal>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name PUBLIC \"valid-pubid-literal\" invalid-system-literal>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -118,7 +118,7 @@ def test_no_quote_in_public

def test_mixed_quote_in_system
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name SYSTEM \'invalid-system-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name SYSTEM 'invalid-system-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -131,7 +131,7 @@ def test_mixed_quote_in_system

def test_mixed_quote_in_public
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name PUBLIC "valid-pubid-literal" "invalid-system-literal\'>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name PUBLIC \"valid-pubid-literal\" \"invalid-system-literal'>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -144,7 +144,7 @@ def test_mixed_quote_in_public

def test_no_literal_in_system
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name SYSTEM>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name SYSTEM>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -157,7 +157,7 @@ def test_no_literal_in_system

def test_no_literal_in_public
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name PUBLIC "valid-pubid-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name PUBLIC \"valid-pubid-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -174,7 +174,7 @@ def test_no_literal_in_public
class TestPublicIDLiteral < self
def test_no_quote
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name PUBLIC invalid-pubid-literal "valid-system-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name PUBLIC invalid-pubid-literal \"valid-system-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -201,7 +201,7 @@ def test_prohibited_pubid_character

def test_mixed_quote
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name PUBLIC "invalid-pubid-literal\' "valid-system-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name PUBLIC \"invalid-pubid-literal' \"valid-system-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -214,7 +214,7 @@ def test_mixed_quote

def test_no_literal
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name PUBLIC>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name PUBLIC>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -232,7 +232,7 @@ class TestNotationDataDeclaration < self
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-NameChar
def test_prohibited_character
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name PUBLIC "valid-pubid-literal" "valid-system-literal" NDATA invalid&name>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name PUBLIC \"valid-pubid-literal\" \"valid-system-literal\" NDATA invalid&name>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -246,7 +246,7 @@ def test_prohibited_character

def test_entity_value_and_notation_data_declaration
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name "valid-entity-value" NDATA valid-ndata-value>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-name \"valid-entity-value\" NDATA valid-ndata-value>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -260,7 +260,7 @@ def test_entity_value_and_notation_data_declaration

def test_no_space
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-namePUBLIC"valid-pubid-literal""valid-system-literal"NDATAvalid-name>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY valid-namePUBLIC\"valid-pubid-literal\"\"valid-system-literal\"NDATAvalid-name>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -278,7 +278,7 @@ class TestParsedEntityDeclaration < self
class TestName < self
def test_prohibited_character
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % invalid&name "valid-entity-value">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % invalid&name \"valid-entity-value\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -296,7 +296,7 @@ class TestParsedEntityDefinition < self
class TestEntityValue < self
def test_no_quote
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name invalid-entity-value>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name invalid-entity-value>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -309,7 +309,7 @@ def test_no_quote

def test_prohibited_character
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name "% &">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name \"% &\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -322,7 +322,7 @@ def test_prohibited_character

def test_mixed_quote
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name \'invalid-entity-value">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name 'invalid-entity-value\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -340,7 +340,7 @@ class TestExternalID < self
class TestSystemLiteral < self
def test_no_quote_in_system
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name SYSTEM invalid-system-literal>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name SYSTEM invalid-system-literal>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -353,7 +353,7 @@ def test_no_quote_in_system

def test_no_quote_in_public
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name PUBLIC "valid-pubid-literal" invalid-system-literal>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name PUBLIC \"valid-pubid-literal\" invalid-system-literal>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -366,7 +366,7 @@ def test_no_quote_in_public

def test_mixed_quote_in_system
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name SYSTEM "invalid-system-literal\'>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name SYSTEM \"invalid-system-literal'>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -379,7 +379,7 @@ def test_mixed_quote_in_system

def test_mixed_quote_in_public
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name PUBLIC "valid-pubid-literal" \'invalid-system-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name PUBLIC \"valid-pubid-literal\" 'invalid-system-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -392,7 +392,7 @@ def test_mixed_quote_in_public

def test_no_literal_in_system
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name SYSTEM>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name SYSTEM>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -405,7 +405,7 @@ def test_no_literal_in_system

def test_no_literal_in_public
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name PUBLIC "valid-pubid-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name PUBLIC \"valid-pubid-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -422,7 +422,7 @@ def test_no_literal_in_public
class TestPublicIDLiteral < self
def test_no_quote
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name PUBLIC invalid-pubid-literal "valid-system-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name PUBLIC invalid-pubid-literal \"valid-system-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -449,7 +449,7 @@ def test_prohibited_pubid_character

def test_mixed_quote
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name PUBLIC \'invalid-pubid-literal" "valid-system-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name PUBLIC 'invalid-pubid-literal\" \"valid-system-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -462,7 +462,7 @@ def test_mixed_quote

def test_no_literal
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name PUBLIC>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name PUBLIC>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -477,7 +477,7 @@ def test_no_literal

def test_entity_value_and_notation_data_declaration
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name "valid-entity-value" NDATA valid-ndata-value>]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY % valid-name \"valid-entity-value\" NDATA valid-ndata-value>]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand All @@ -491,7 +491,7 @@ def test_entity_value_and_notation_data_declaration

def test_no_space
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY %valid-nameSYSTEM"valid-system-literal">]>')
REXML::Document.new("<!DOCTYPE root [<!ENTITY %valid-nameSYSTEM\"valid-system-literal\">]>")
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Expand Down

0 comments on commit 556487b

Please sign in to comment.