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 2018/12/18 06:57:30 UTC

[groovy] branch GROOVY_2_5_X updated: build tweak: move test to use a slightly earlier phase to avoid stray class files from being produced

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_2_5_X by this push:
     new 193dcef  build tweak: move test to use a slightly earlier phase to avoid stray class files from being produced
193dcef is described below

commit 193dcef71de35270981241201b5e208da0546459
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Dec 18 16:46:38 2018 +1000

    build tweak: move test to use a slightly earlier phase to avoid stray class files from being produced
---
 .../org/codehaus/groovy/macro/MacroTest.groovy     | 33 +++++++++-------------
 1 file changed, 13 insertions(+), 20 deletions(-)

diff --git a/subprojects/groovy-macro/src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy b/subprojects/groovy-macro/src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy
index 5e50088..e3bade5 100644
--- a/subprojects/groovy-macro/src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy
+++ b/subprojects/groovy-macro/src/test/groovy/org/codehaus/groovy/macro/MacroTest.groovy
@@ -120,41 +120,34 @@ class MacroTest extends GroovyTestCase {
 
     void testCompilePhase() {
         assertScript '''
-        import org.codehaus.groovy.ast.expr.*;
-        import org.codehaus.groovy.ast.stmt.*;
-        import org.codehaus.groovy.ast.ClassHelper;
-        import org.codehaus.groovy.ast.builder.AstAssert;
-        import org.codehaus.groovy.control.CompilePhase;
+        import org.codehaus.groovy.ast.builder.AstAssert
+        import org.codehaus.groovy.control.CompilePhase
 
-        import static org.codehaus.groovy.ast.tools.GeneralUtils.*;
+        import static org.codehaus.groovy.ast.tools.GeneralUtils.*
 
-
-        def result = macro(CompilePhase.FINALIZATION) {
+        def result = macro(CompilePhase.CLASS_GENERATION) {
             println "foo"
             println "bar"
         }
 
         def expected = block(
             stmt(callThisX("println", args(constX("foo")))),
-            // In FINALIZATION phase last println will be ReturnStatement
+            // by end of CLASS_GENERATION phase last println will be ReturnStatement
             returnS(callThisX("println", args(constX("bar")))),
         )
 
-        AstAssert.assertSyntaxTree([expected], [result]);
-'''
+        AstAssert.assertSyntaxTree([expected], [result])
+        '''
     }
 
     void testAsIsWithCompilePhase() {
         assertScript '''
-        import org.codehaus.groovy.ast.expr.*;
-        import org.codehaus.groovy.ast.stmt.*;
-        import org.codehaus.groovy.ast.ClassHelper;
-        import org.codehaus.groovy.ast.builder.AstAssert;
-        import org.codehaus.groovy.control.CompilePhase;
+        import org.codehaus.groovy.ast.builder.AstAssert
+        import org.codehaus.groovy.control.CompilePhase
 
-        import static org.codehaus.groovy.ast.tools.GeneralUtils.*;
+        import static org.codehaus.groovy.ast.tools.GeneralUtils.*
 
-        def result = macro(CompilePhase.FINALIZATION, true) {
+        def result = macro(CompilePhase.CLASS_GENERATION, true) {
             println "foo"
         }
 
@@ -162,8 +155,8 @@ class MacroTest extends GroovyTestCase {
             returnS(callThisX("println", args(constX("foo"))))
         )
 
-        AstAssert.assertSyntaxTree([expected], [result]);
-'''
+        AstAssert.assertSyntaxTree([expected], [result])
+        '''
     }
 
     void testCompileStatic() {