-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Fix invalid XML with spaces before the XML declaration (#115)
## Why? XML declaration allowed only at the start of the document. https://www.w3.org/TR/2006/REC-xml11-20060816/#document ``` [1] document ::= ( prolog element Misc* ) - ( Char* RestrictedChar Char* ) ``` It doesn't have `S*` before `prolog`. https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-prolog ``` [22] prolog ::= XMLDecl Misc* (doctypedecl Misc*)? ``` It doesn't have `S*` before `XMLdecl`. https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-XMLDecl ``` [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' ``` It doesn't have `S*` before `'<?xml'`.
- Loading branch information
Showing
9 changed files
with
86 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ class Tester < Test::Unit::TestCase | |
include Helper::Fixture | ||
include REXML | ||
def setup | ||
@xsa_source = <<-EOL | ||
@xsa_source = <<~EOL | ||
<?xml version="1.0"?> | ||
<?xsl stylesheet="blah.xsl"?> | ||
<!-- The first line tests the XMLDecl, the second tests PI. | ||
|
@@ -89,7 +89,7 @@ def test_attribute | |
|
||
# Bryan Murphy <[email protected]> | ||
text = "this is a {target[@name='test']/@value} test" | ||
source = <<-EOL | ||
source = <<~EOL | ||
<?xml version="1.0"?> | ||
<doc search="#{text}"/> | ||
EOL | ||
|
@@ -869,7 +869,7 @@ def test_attlist_decl | |
assert_equal 'two', doc.root.elements[1].namespace | ||
assert_equal 'foo', doc.root.namespace | ||
|
||
doc = Document.new <<-EOL | ||
doc = Document.new <<~EOL | ||
<?xml version="1.0"?> | ||
<!DOCTYPE schema SYSTEM "XMLSchema.dtd" [ | ||
<!ENTITY % p ''> | ||
|
@@ -946,7 +946,7 @@ def test_processing_instruction | |
end | ||
|
||
def test_oses_with_bad_EOLs | ||
Document.new("\n\n\n<?xml version='1.0'?>\n\n\n<a/>\n\n") | ||
Document.new("<?xml version='1.0'?>\n\n\n<a/>\n\n") | ||
end | ||
|
||
# Contributed (with patch to fix bug) by Kouhei | ||
|
@@ -973,7 +973,7 @@ def test_0xD_in_preface | |
end | ||
|
||
def test_hyphens_in_doctype | ||
doc = REXML::Document.new <<-EOQ | ||
doc = REXML::Document.new <<~EOQ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE a-b-c> | ||
<a-b-c> | ||
|
@@ -1089,7 +1089,7 @@ def test_null_element_name | |
def test_text_raw | ||
# From the REXML tutorial | ||
# (http://www.germane-software.com/software/rexml/test/data/tutorial.html) | ||
doc = Document.new <<-EOL | ||
doc = Document.new <<~EOL | ||
<?xml version="1.0"?> | ||
<!DOCTYPE schema SYSTEM "XMLSchema.dtd" [ | ||
<!ENTITY % s 'Sean'> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.