You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/10/23 09:35:53 UTC

groovy git commit: ignore slight xml whitespace formatting changes on jdk9

Repository: groovy
Updated Branches:
  refs/heads/master 33b72ea34 -> a6d5b3f9e


ignore slight xml whitespace formatting changes on jdk9


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a6d5b3f9
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a6d5b3f9
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a6d5b3f9

Branch: refs/heads/master
Commit: a6d5b3f9e50bcc99a939664119a53cc8394743bd
Parents: 33b72ea
Author: paulk <pa...@asert.com.au>
Authored: Mon Oct 23 19:35:45 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Mon Oct 23 19:35:45 2017 +1000

----------------------------------------------------------------------
 .../groovy/groovy/xml/NamespaceNodeTest.groovy    | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a6d5b3f9/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy b/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy
index e1913fd..6fa879c 100644
--- a/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy
+++ b/subprojects/groovy-xml/src/test/groovy/groovy/xml/NamespaceNodeTest.groovy
@@ -93,15 +93,15 @@ class NamespaceNodeTest extends TestXmlSupport {
             innerWithoutNewNamespace("bar")
         }
         
-        def expected = """<?xml version="1.0" encoding="UTF-8"?>\
+        def expected = pretty("""<?xml version="1.0" encoding="UTF-8"?>\
 <outer xmlns="http://foo/bar" id="3">
   <ns1:innerWithNewNamespace xmlns:ns1="http://foo/other" someAttr="someValue">
     <ns1:nested>foo</ns1:nested>
   </ns1:innerWithNewNamespace>
   <innerWithoutNewNamespace>bar</innerWithoutNewNamespace>
 </outer>
-""".replaceAll('[\r\n]','')
-        def actual = XmlUtil.serialize(result).replaceAll("[\r\n]", "")
+""")
+        def actual = pretty(XmlUtil.serialize(result))
         assert actual == expected
     }
 
@@ -111,13 +111,17 @@ class NamespaceNodeTest extends TestXmlSupport {
             inner(name: "foo")
             inner("bar")
         }
-        def expected = """<?xml version="1.0" encoding="UTF-8"?>\
+        def expected = pretty("""<?xml version="1.0" encoding="UTF-8"?>\
 <outer id="3">
   <inner name="foo"/>
   <inner>bar</inner>
 </outer>
-""".replaceAll('[\r\n]','')
-        def actual = XmlUtil.serialize(result).replaceAll("[\r\n]", "")
+""")
+        def actual = pretty(XmlUtil.serialize(result))
         assert actual == expected
     }
-}
\ No newline at end of file
+
+    private static String pretty(String s) {
+        s.normalize().replaceAll("[\n]", "").replaceAll('[ ]+',' ').replaceAll('> <','><')
+    }
+}