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 10:26:42 UTC
[3/3] groovy git commit: ignore slight xml whitespace formatting
changes on jdk9
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/7f7da998
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/7f7da998
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/7f7da998
Branch: refs/heads/GROOVY_2_6_X
Commit: 7f7da99854fe317697178397fa696faf51cc38b4
Parents: 240d576
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 20:26:24 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/7f7da998/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('> <','><')
+ }
+}