Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X 5531e6ca0 -> 8b96a5e24
Fix the failing build (cherry picked from commit 3284b55) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/8b96a5e2 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/8b96a5e2 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/8b96a5e2 Branch: refs/heads/GROOVY_2_6_X Commit: 8b96a5e24daea3c7a3461694d1112abae53938c2 Parents: 5531e6c Author: danielsun1106 <[email protected]> Authored: Sat Jun 2 22:02:29 2018 +0800 Committer: danielsun1106 <[email protected]> Committed: Sat Jun 2 22:03:58 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/8b96a5e2/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 0d73dde..581b1dd 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 @@ -441,6 +441,6 @@ class GroovyParserTest extends GroovyTestCase { 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/8b96a5e2/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 [email protected] +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() [email protected] +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()
