groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Fix the failing build
Date Sat, 02 Jun 2018 14:02:13 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 37f8a8e8b -> 3284b552f


Fix the failing build


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

Branch: refs/heads/master
Commit: 3284b552f52c5209537384ce070da59f9724d270
Parents: 37f8a8e
Author: danielsun1106 <realbluesun@hotmail.com>
Authored: Sat Jun 2 22:02:29 2018 +0800
Committer: danielsun1106 <realbluesun@hotmail.com>
Committed: Sat Jun 2 22:02:29 2018 +0800

----------------------------------------------------------------------
 .../parser/antlr4/GroovyParserTest.groovy       |  2 +-
 .../test/resources/bugs/BUG-GROOVY-8613.groovy  | 53 ++++++++------------
 2 files changed, 21 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/3284b552/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
index 2b1e4be..2384b85 100644
--- a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -428,6 +428,6 @@ class GroovyParserTest extends GroovyTestCase {
         doRunAndTestAntlr4('bugs/BUG-GROOVY-8311.groovy')
         doRunAndTest('bugs/BUG-GROOVY-8426.groovy')
         doTest('bugs/BUG-GROOVY-8511.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-8613.groovy')
+        doRunAndTestAntlr4('bugs/BUG-GROOVY-8613.groovy')
     }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/3284b552/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8613.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8613.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8613.groovy
index 4e527f2..c7c1f30 100644
--- a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8613.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8613.groovy
@@ -16,39 +16,26 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package bugs
+@groovy.transform.CompileStatic
+def foo() {
+    def a = 0
+    a ?= 1
+    assert 1 == a
+    def b = 0
+    b ?= "hello"
+    assert 'hello' == b
+}
 
-class Groovy8613Bug extends GroovyTestCase {
-    void testElvisAssign() {
-        assertScript '''
-        @groovy.transform.CompileStatic
-        def foo() {
-          def a = 0
-          a ?= 1
-          assert 1 == a
-          def b = 0
-          b ?= "hello"
-          assert 'hello' == b
-        }
-        
-        foo()
-        '''
-    }
+foo()
 
+@groovy.transform.CompileStatic
+def foo2() {
+    def a = 0
+    a = a ?: 1
+    assert 1 == a
+    def b = 0
+    b = b ?: "hello"
+    assert 'hello' == b
+}
 
-    void testElvisOp() {
-        assertScript '''
-        @groovy.transform.CompileStatic
-        def foo() {
-          def a = 0
-          a = a ?: 1
-          assert 1 == a
-          def b = 0
-          b = b ?: "hello"
-          assert 'hello' == b
-        }
-        
-        foo()
-        '''
-    }
-}
\ No newline at end of file
+foo2()


Mime
View raw message