Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X c2cd68047 -> b3b570489


Simplify the test for "GROOVY-4585: backslash can not be escaped by 
`SimpleTemplateEngine`"

(cherry picked from commit 697136d)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: b3b570489483c135b32e62e42095e021726c4d01
Parents: c2cd680
Author: danielsun1106 <realblue...@hotmail.com>
Authored: Fri Apr 6 22:49:46 2018 +0800
Committer: danielsun1106 <realblue...@hotmail.com>
Committed: Fri Apr 6 22:50:44 2018 +0800

----------------------------------------------------------------------
 src/test/groovy/bugs/groovy4585/Groovy4585Bug.groovy | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/b3b57048/src/test/groovy/bugs/groovy4585/Groovy4585Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/groovy4585/Groovy4585Bug.groovy 
b/src/test/groovy/bugs/groovy4585/Groovy4585Bug.groovy
index fed604e..17f9120 100644
--- a/src/test/groovy/bugs/groovy4585/Groovy4585Bug.groovy
+++ b/src/test/groovy/bugs/groovy4585/Groovy4585Bug.groovy
@@ -20,14 +20,11 @@ package groovy.bugs.groovy4585
 
 class Groovy4585Bug extends GroovyTestCase {
     void test() {
-        assertScript '''
-            package groovy.bugs.groovy4585
-            def engineForBuildXml = new 
groovy.text.SimpleTemplateEngine(false, true)
-            def templateForBuildXml = 
engineForBuildXml.createTemplate(this.getClass().getResource("/groovy/bugs/groovy4585/groovy4585.xml").text)
-            String buildXmlContent = templateForBuildXml.make([names:['a', 
'b', 'c']]).toString()
-    
-            assert buildXmlContent.contains('<property name="drive" 
value="d:\\\\" />')
-            assert buildXmlContent.contains('<exec dir="${drive}" 
executable="echo">')
-        '''
+        def engineForBuildXml = new groovy.text.SimpleTemplateEngine(false, 
true)
+        def templateForBuildXml = 
engineForBuildXml.createTemplate(this.getClass().getResource("/groovy/bugs/groovy4585/groovy4585.xml").text)
+        String buildXmlContent = templateForBuildXml.make([names:['a', 'b', 
'c']]).toString()
+
+        assert buildXmlContent.contains('<property name="drive" value="d:\\" 
/>')
+        assert buildXmlContent.contains('<exec dir="${drive}" 
executable="echo">')
     }
 }

Reply via email to