[tracker/wip/carlosg/sparql-corners: 7/12] tests: Add tests for LIMIT/OFFSET modifiers




commit fd38d9a3a6d027ab29e11272e41236ff3475deda
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Feb 27 12:44:11 2021 +0100

    tests: Add tests for LIMIT/OFFSET modifiers
    
    Test all combinations and orders of these 2 modifiers.

 tests/libtracker-data/algebra/modifier-limit-1.out        | 1 +
 tests/libtracker-data/algebra/modifier-limit-1.rq         | 1 +
 tests/libtracker-data/algebra/modifier-limit-offset-1.out | 1 +
 tests/libtracker-data/algebra/modifier-limit-offset-1.rq  | 1 +
 tests/libtracker-data/algebra/modifier-limit-offset-2.out | 1 +
 tests/libtracker-data/algebra/modifier-limit-offset-2.rq  | 2 ++
 tests/libtracker-data/algebra/modifier-offset-1.out       | 2 ++
 tests/libtracker-data/algebra/modifier-offset-1.rq        | 1 +
 tests/libtracker-data/tracker-sparql-test.c               | 4 ++++
 9 files changed, 14 insertions(+)
---
diff --git a/tests/libtracker-data/algebra/modifier-limit-1.out 
b/tests/libtracker-data/algebra/modifier-limit-1.out
new file mode 100644
index 000000000..f27b76c59
--- /dev/null
+++ b/tests/libtracker-data/algebra/modifier-limit-1.out
@@ -0,0 +1 @@
+"1"
diff --git a/tests/libtracker-data/algebra/modifier-limit-1.rq 
b/tests/libtracker-data/algebra/modifier-limit-1.rq
new file mode 100644
index 000000000..2d0e3b986
--- /dev/null
+++ b/tests/libtracker-data/algebra/modifier-limit-1.rq
@@ -0,0 +1 @@
+SELECT ?a { VALUES ?a { 1 2 3 } } LIMIT 1
diff --git a/tests/libtracker-data/algebra/modifier-limit-offset-1.out 
b/tests/libtracker-data/algebra/modifier-limit-offset-1.out
new file mode 100644
index 000000000..1026c253e
--- /dev/null
+++ b/tests/libtracker-data/algebra/modifier-limit-offset-1.out
@@ -0,0 +1 @@
+"2"
diff --git a/tests/libtracker-data/algebra/modifier-limit-offset-1.rq 
b/tests/libtracker-data/algebra/modifier-limit-offset-1.rq
new file mode 100644
index 000000000..5a60710b4
--- /dev/null
+++ b/tests/libtracker-data/algebra/modifier-limit-offset-1.rq
@@ -0,0 +1 @@
+SELECT ?a { VALUES ?a { 1 2 3 } } LIMIT 1 OFFSET 1
diff --git a/tests/libtracker-data/algebra/modifier-limit-offset-2.out 
b/tests/libtracker-data/algebra/modifier-limit-offset-2.out
new file mode 100644
index 000000000..1026c253e
--- /dev/null
+++ b/tests/libtracker-data/algebra/modifier-limit-offset-2.out
@@ -0,0 +1 @@
+"2"
diff --git a/tests/libtracker-data/algebra/modifier-limit-offset-2.rq 
b/tests/libtracker-data/algebra/modifier-limit-offset-2.rq
new file mode 100644
index 000000000..83aefe64e
--- /dev/null
+++ b/tests/libtracker-data/algebra/modifier-limit-offset-2.rq
@@ -0,0 +1,2 @@
+# Try OFFSET/LIMIT ordering
+SELECT ?a { VALUES ?a { 1 2 3 } } OFFSET 1 LIMIT 1
diff --git a/tests/libtracker-data/algebra/modifier-offset-1.out 
b/tests/libtracker-data/algebra/modifier-offset-1.out
new file mode 100644
index 000000000..f1861d764
--- /dev/null
+++ b/tests/libtracker-data/algebra/modifier-offset-1.out
@@ -0,0 +1,2 @@
+"2"
+"3"
diff --git a/tests/libtracker-data/algebra/modifier-offset-1.rq 
b/tests/libtracker-data/algebra/modifier-offset-1.rq
new file mode 100644
index 000000000..3059b418a
--- /dev/null
+++ b/tests/libtracker-data/algebra/modifier-offset-1.rq
@@ -0,0 +1 @@
+SELECT ?a { VALUES ?a { 1 2 3 } } OFFSET 1
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index abff972a5..6a92ba744 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -62,6 +62,10 @@ const TestInfo tests[] = {
        { "algebra/filter-in-4", "algebra/data-2", FALSE },
        { "algebra/filter-in-5", "algebra/data-2", FALSE },
        { "algebra/var-scope-join-1", "algebra/var-scope-join-1", FALSE },
+       { "algebra/modifier-limit-offset-1", "algebra/data-1", FALSE },
+       { "algebra/modifier-limit-offset-2", "algebra/data-1", FALSE },
+       { "algebra/modifier-limit-1", "algebra/data-1", FALSE },
+       { "algebra/modifier-offset-1", "algebra/data-1", FALSE },
        { "anon/query", "anon/data", FALSE },
        { "anon/query-2", "anon/data", FALSE },
        { "anon/query-3", "anon/data", FALSE },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]