Repository: groovy Updated Branches: refs/heads/GROOVY_2_5_X 80fe71566 -> da5a042cf
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/07219dce Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/07219dce Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/07219dce Branch: refs/heads/GROOVY_2_5_X Commit: 07219dce71216dc9208491b7f50c387888022702 Parents: 80fe715 Author: paulk <[email protected]> Authored: Mon Oct 23 19:35:45 2017 +1000 Committer: Paul King <[email protected]> Committed: Thu Sep 13 09:42:42 2018 +1000 ---------------------------------------------------------------------- .../groovy/groovy/xml/NamespaceNodeTest.groovy | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/07219dce/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('> <','><') + } +}
