You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2021/03/30 14:52:54 UTC

[groovy] branch master updated (e1e1e8a -> 35b16b8)

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

emilles pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from e1e1e8a  minor stuff
     new e3983c1  GROOVY-7978: add test case
     new 35b16b8  GROOVY-7989: add test case

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../bugs/{Groovy6996.groovy => Groovy7978.groovy}  | 47 +++++++++++-----------
 .../bugs/{Groovy9294.groovy => Groovy7989.groovy}  | 28 ++++++-------
 2 files changed, 36 insertions(+), 39 deletions(-)
 copy src/test/groovy/bugs/{Groovy6996.groovy => Groovy7978.groovy} (54%)
 copy src/test/groovy/bugs/{Groovy9294.groovy => Groovy7989.groovy} (68%)

[groovy] 01/02: GROOVY-7978: add test case

Posted by em...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e3983c152e27ae4c33d1428d02d687cff7f5e184
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Tue Mar 30 09:20:11 2021 -0500

    GROOVY-7978: add test case
---
 src/test/groovy/bugs/Groovy7978.groovy | 58 ++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/src/test/groovy/bugs/Groovy7978.groovy b/src/test/groovy/bugs/Groovy7978.groovy
new file mode 100644
index 0000000..44c5dfb
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy7978.groovy
@@ -0,0 +1,58 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs
+
+import org.junit.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+final class Groovy7978 {
+
+    @Test
+    void testPreIncrementInAssert() {
+        ['', '@groovy.transform.TypeChecked', '@groovy.transform.CompileStatic'].each { annotaion ->
+            assertScript """
+                $annotaion
+                class Main {
+                    private int counter = 0
+                    void test() {
+                        assert (++this.counter)
+                    }
+                }
+                new Main().test()
+            """
+        }
+    }
+
+    @Test
+    void testPostIncrementInAssert() {
+        ['', '@groovy.transform.TypeChecked', '@groovy.transform.CompileStatic'].each { annotaion ->
+            assertScript """
+                $annotaion
+                class Main {
+                    private int counter = 0
+                    void test() {
+                        assert !(this.counter++)
+                    }
+                }
+                new Main().test()
+            """
+        }
+    }
+}

[groovy] 02/02: GROOVY-7989: add test case

Posted by em...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 35b16b8e4f68e1d2f36a8fb1c70df2050f778a20
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Tue Mar 30 09:33:33 2021 -0500

    GROOVY-7989: add test case
---
 src/test/groovy/bugs/Groovy7989.groovy | 41 ++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/src/test/groovy/bugs/Groovy7989.groovy b/src/test/groovy/bugs/Groovy7989.groovy
new file mode 100644
index 0000000..e4594f7
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy7989.groovy
@@ -0,0 +1,41 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs
+
+import org.junit.Test
+
+import static groovy.test.GroovyAssert.assertScript
+
+final class Groovy7989 {
+    @Test
+    void testListCloneInStaticInitializer() {
+        ['', '@groovy.transform.TypeChecked', '@groovy.transform.CompileStatic'].each { annotaion ->
+            assertScript """
+                $annotaion
+                class Main {
+                    static {
+                        List list = []
+                        list.clone()
+                    }
+                }
+                new Main()
+            """
+        }
+    }
+}