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 <[email protected]>
Authored: Wed Jan 25 00:08:29 2017 +0800
Committer: sunlan <[email protected]>
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

Reply via email to