You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2022/07/03 10:21:34 UTC
[groovy] branch GROOVY_4_0_X updated: Add 1 more test case for GINQ
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_4_0_X by this push:
new 2e4cc89bb1 Add 1 more test case for GINQ
2e4cc89bb1 is described below
commit 2e4cc89bb198b00126012e122c0a6bb7cbccc257
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Jul 3 18:14:11 2022 +0800
Add 1 more test case for GINQ
(cherry picked from commit 6a6f36482ff1f288edb69e9608681c1fba1ff395)
---
.../test/org/apache/groovy/ginq/GinqTest.groovy | 22 ++++++++++++++++++++++
1 file changed, 22 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 2c491f9dc0..b0be6e27f1 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
@@ -6224,6 +6224,28 @@ class GinqTest {
'''
}
+ @Test
+ void "testGinq - window - 91"() {
+ assertGinqScript '''
+ def r = GQ {
+ from n in [2, 1, 3]
+ join m in [2, 1, 3] on m == n
+ select n, (lag(n) over(orderby n)) as lagN
+ }
+ def expected = """
++---+------+
+| n | lagN |
++---+------+
+| 2 | 1 |
+| 1 | |
+| 3 | 2 |
++---+------+
+"""
+
+ assert expected == r.toString()
+ '''
+ }
+
@Test
void "testGinq - switch - 1"() {
assertGinqScript '''