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 2017/04/11 01:37:54 UTC

[18/50] groovy git commit: Add more test cases for ++ and -- operators

Add more test cases for ++ and -- operators


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

Branch: refs/heads/master
Commit: a8e2874f794590c0d4ae1e5b92fb94d0419fdf65
Parents: 956582d
Author: sunlan <su...@apache.org>
Authored: Wed Jan 25 00:08:29 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Wed Jan 25 00:08:29 2017 +0800

----------------------------------------------------------------------
 .../apache/groovy/parser/antlr4/GroovyParserTest.groovy  |  2 ++
 .../src/test/resources/core/Expression_22x.groovy        | 11 +++++++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a8e2874f/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
index 86309c3..5b78c40 100644
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -186,6 +186,8 @@ class GroovyParserTest extends GroovyTestCase {
         doTest('core/Expression_19.groovy');
         doTest('core/Expression_20.groovy');
         doRunAndTest('core/Expression_21x.groovy');
+        doTest('core/Expression_22x.groovy');
+        doRunAndTest('core/Expression_22x.groovy');
     }
 
     void "test groovy core - IdenticalOp"() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a8e2874f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
new file mode 100644
index 0000000..77a3306
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
@@ -0,0 +1,11 @@
+int j = 0
+++j++
+assert j == 1
+
+int i = 0
+((i++)++)++
+assert i == 1
+++(++(++i))
+assert i == 2
+++(++(++i++)++)++
+assert i == 3