10000 Add more invalid test cases for parsing entitly declaration by Watson1978 · Pull Request #183 · ruby/rexml · GitHub
[go: up one dir, main page]

Skip to content

Add more invalid test cases for parsing entitly declaration #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jul 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix class name
  • Loading branch information
Watson1978 committed Jul 23, 2024
commit daaf61527918e8341c3c36c8e6d85c1329573d64
12 changes: 6 additions & 6 deletions test/parse/test_entity_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_prohibited_character
end

# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-ExternalID
class TestExternalId < self
class TestExternalID < self
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-SystemLiteral
class TestSystemLiteral < self
def test_no_quote_in_system
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_no_quote_in_public

# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PubidLiteral
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PubidChar
class TestPubidLiteral < self
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">]>')
Expand Down Expand Up @@ -120,7 +120,7 @@ def test_invalid_pubid_char
end

# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-NDataDecl
class TestNDataDeclaration < self
class TestNotationDataDeclaration < self
def test_no_quote
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "no quote" a suitable reason?
I think that NDATA is only the valid keyword.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry. It is my mistake.

exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-name PUBLIC "valid-pubid-literal" "valid-system-literal" invalid-ndata valid-ndata-value>]>')
Expand All @@ -141,7 +141,7 @@ def test_no_quote
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PEDecl
class TestParsedEntityDeclaration < self
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PEDef
class ParsedEntityDefinition < self
class TestParsedEntityDefinition < self
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EntityValue
class TestEntityValue < self
def test_no_quote
Expand Down Expand Up @@ -172,7 +172,7 @@ def test_prohibited_character
end

# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-ExternalID
class TestExternalId < self
class TestExternalID < self
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-SystemLiteral
class TestSystemLiteral < self
def test_no_quote_in_system
Expand Down Expand Up @@ -204,7 +204,7 @@ def test_no_quote_in_public

# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PubidLiteral
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PubidChar
class TestPubidLiteral < self
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">]>')
Expand Down
0