From fb7ba27594ce15e2a0a566c837355cb4beb4db14 Mon Sep 17 00:00:00 2001 From: NAITOH Jun Date: Wed, 21 Feb 2024 06:17:35 +0900 Subject: [PATCH] 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 ::= '' ``` It doesn't have `S*` before `' diff --git a/test/test_contrib.rb b/test/test_contrib.rb index f3ad0b6c..23ee35b1 100644 --- a/test/test_contrib.rb +++ b/test/test_contrib.rb @@ -80,7 +80,7 @@ def test_bad_doctype_Tobias # Peter Verhage def test_namespace_Peter - source = <<-EOF + source = <<~EOF @@ -377,7 +377,7 @@ def test_various_xpath end def test_entities_Holden_Glova - document = <<-EOL + document = <<~EOL diff --git a/test/test_core.rb b/test/test_core.rb index 8c33d834..5668b934 100644 --- a/test/test_core.rb +++ b/test/test_core.rb @@ -15,7 +15,7 @@ class Tester < Test::Unit::TestCase include Helper::Fixture include REXML def setup - @xsa_source = <<-EOL + @xsa_source = <<~EOL