Skip to content

Commit

Permalink
Adjust the position of test and rename the method
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Jul 23, 2024
1 parent f7d4a08 commit c211ab5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions test/parse/test_entity_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@ def test_prohibited_character
valid-name \"% &\">]>
DETAIL
end

def test_unnecessary_ndata_declaration
exception = assert_raise(REXML::ParseException) do
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
Line: 1
Position: 83
Last 80 unconsumed characters:
valid-name \"valid-entity-value\" NDATA valid-ndata-value>]>
DETAIL
end
end

# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-ExternalID
Expand Down Expand Up @@ -165,6 +152,19 @@ def test_prohibited_character
DETAIL
end
end

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>]>')
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Line: 1
Position: 83
Last 80 unconsumed characters:
valid-name \"valid-entity-value\" NDATA valid-ndata-value>]>
DETAIL
end
end
end

Expand Down Expand Up @@ -280,7 +280,7 @@ def test_invalid_pubid_char
end
end

def test_unnecessary_ndata_declaration
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>]>')
end
Expand Down

0 comments on commit c211ab5

Please sign in to comment.