[groovy] branch master updated: Add more tests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[groovy] branch master updated: Add more tests

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 862610b  Add more tests
862610b is described below

commit 862610bb00eaef1227b19698bbaf463719447405
Author: Daniel Sun <[hidden email]>
AuthorDate: Sun Nov 22 02:17:16 2020 +0800

    Add more tests
---
 .../test/org/apache/groovy/ginq/GinqTest.groovy    | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/subprojects/groovy-ginq/src/spec/test/org/apache/groovy/ginq/GinqTest.groovy b/subprojects/groovy-ginq/src/spec/test/org/apache/groovy/ginq/GinqTest.groovy
index 8a36357..4ef56f2 100644
--- a/subprojects/groovy-ginq/src/spec/test/org/apache/groovy/ginq/GinqTest.groovy
+++ b/subprojects/groovy-ginq/src/spec/test/org/apache/groovy/ginq/GinqTest.groovy
@@ -2546,6 +2546,21 @@ class GinqTest {
     }
 
     @Test
+    void "testGinq - exists - 2"() {
+        assertScript '''
+            assert [2, 3] == GQ {
+                from n in [1, 2, 3]
+                where 1 == 1 && (
+                    from m in [2, 3]
+                    where m == n
+                    select m
+                ).exists()
+                select n
+            }.toList()
+        '''
+    }
+
+    @Test
     void "testGinq - not exists - 1"() {
         assertScript '''
             assert [1] == GQ {
@@ -2561,4 +2576,19 @@ class GinqTest {
             }.toList()
         '''
     }
+
+    @Test
+    void "testGinq - not exists - 2"() {
+        assertScript '''
+            assert [1] == GQ {
+                from n in [1, 2, 3]
+                where 1 == 1 && !(
+                    from m in [2, 3]
+                    where m == n
+                    select m
+                ).exists()
+                select n
+            }.toList()
+        '''
+    }
 }

Apache Groovy committer & PMC member

Blog: http://blog.sunlan.me
Twitter: @daniel_sun