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.gitThe following commit(s) were added to refs/heads/master by this push:
new e6456cd Tweak doco
e6456cd is described below
commit e6456cd49c1da4147edb090e14e341b37568e970
Author: Daniel Sun <
[hidden email]>
AuthorDate: Sun Nov 22 03:09:17 2020 +0800
Tweak doco
---
.../groovy-ginq/src/spec/doc/ginq-userguide.adoc | 5 +++++
.../spec/test/org/apache/groovy/ginq/GinqTest.groovy | 17 +++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/subprojects/groovy-ginq/src/spec/doc/ginq-userguide.adoc b/subprojects/groovy-ginq/src/spec/doc/ginq-userguide.adoc
index a7aec83..2d9deed 100644
--- a/subprojects/groovy-ginq/src/spec/doc/ginq-userguide.adoc
+++ b/subprojects/groovy-ginq/src/spec/doc/ginq-userguide.adoc
@@ -261,6 +261,11 @@ include::../test/org/apache/groovy/ginq/GinqTest.groovy[tags=ginq_nested_01,inde
include::../test/org/apache/groovy/ginq/GinqTest.groovy[tags=ginq_nested_02,indent=0]
----
+[source, sql]
+----
+include::../test/org/apache/groovy/ginq/GinqTest.groovy[tags=ginq_filtering_04,indent=0]
+----
+
=== GINQ Tips
==== Row Number
`_rn` is the implicit variable representing row number for each record in the result set. It starts with `0`
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 4ef56f2..0955c52 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
@@ -2561,6 +2561,23 @@ class GinqTest {
}
@Test
+ void "testGinq - exists - 3"() {
+ assertScript '''
+ assert [1, 2] == GQ {
+// tag::ginq_filtering_04[]
+ from n in [0, 1, 2]
+ where (
+ from m in [1, 2]
+ where m == n
+ select m
+ ).exists()
+ select n
+// end::ginq_filtering_04[]
+ }.toList()
+ '''
+ }
+
+ @Test
void "testGinq - not exists - 1"() {
assertScript '''
assert [1] == GQ {