[tracker/wip/carlosg/vars-in-service: 2/2] tests: Add tests for variables instead of service literals




commit 737999880a214642cc7e35b2a4d96cc366245081
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jan 26 10:38:20 2021 +0100

    tests: Add tests for variables instead of service literals
    
    Add tests for "SERVICE ?s {}" where ?s is resolved in other parts
    of the query.

 tests/libtracker-data/service/service-var-1.out | 16 ++++++++++++++++
 tests/libtracker-data/service/service-var-1.rq  |  6 ++++++
 tests/libtracker-data/service/service-var-2.out | 16 ++++++++++++++++
 tests/libtracker-data/service/service-var-2.rq  |  6 ++++++
 tests/libtracker-data/tracker-service-test.c    |  2 ++
 5 files changed, 46 insertions(+)
---
diff --git a/tests/libtracker-data/service/service-var-1.out b/tests/libtracker-data/service/service-var-1.out
new file mode 100644
index 000000000..5b6a80407
--- /dev/null
+++ b/tests/libtracker-data/service/service-var-1.out
@@ -0,0 +1,16 @@
+"http://tracker.api.gnome.org/ontology/v3/nie#url";
+"http://tracker.api.gnome.org/ontology/v3/nie#mimeType";
+"http://tracker.api.gnome.org/ontology/v3/nie#interpretedAs";
+"http://tracker.api.gnome.org/ontology/v3/nie#isStoredAs";
+"http://tracker.api.gnome.org/ontology/v3/nao#hasTag";
+"http://tracker.api.gnome.org/ontology/v3/nco#nameFamily";
+"http://tracker.api.gnome.org/ontology/v3/nco#phoneNumber";
+"http://tracker.api.gnome.org/ontology/v3/nco#hasEmailAddress";
+"http://tracker.api.gnome.org/ontology/v3/nco#hasPostalAddress";
+"http://tracker.api.gnome.org/ontology/v3/nfo#fileName";
+"http://tracker.api.gnome.org/ontology/v3/nfo#fileLastModified";
+"http://tracker.api.gnome.org/ontology/v3/nmm#artistName";
+"http://tracker.api.gnome.org/ontology/v3/nmm#musicAlbum";
+"http://tracker.api.gnome.org/ontology/v3/nmm#performer";
+"http://tracker.api.gnome.org/ontology/v3/slo#postalAddress";
+"http://tracker.api.gnome.org/ontology/v3/slo#location";
diff --git a/tests/libtracker-data/service/service-var-1.rq b/tests/libtracker-data/service/service-var-1.rq
new file mode 100644
index 000000000..8a5ea245a
--- /dev/null
+++ b/tests/libtracker-data/service/service-var-1.rq
@@ -0,0 +1,6 @@
+SELECT ?u {
+  VALUES ?s { 'dbus:%s' } .
+  SERVICE ?s {
+    ?u nrl:indexed true
+  }
+}
diff --git a/tests/libtracker-data/service/service-var-2.out b/tests/libtracker-data/service/service-var-2.out
new file mode 100644
index 000000000..5b6a80407
--- /dev/null
+++ b/tests/libtracker-data/service/service-var-2.out
@@ -0,0 +1,16 @@
+"http://tracker.api.gnome.org/ontology/v3/nie#url";
+"http://tracker.api.gnome.org/ontology/v3/nie#mimeType";
+"http://tracker.api.gnome.org/ontology/v3/nie#interpretedAs";
+"http://tracker.api.gnome.org/ontology/v3/nie#isStoredAs";
+"http://tracker.api.gnome.org/ontology/v3/nao#hasTag";
+"http://tracker.api.gnome.org/ontology/v3/nco#nameFamily";
+"http://tracker.api.gnome.org/ontology/v3/nco#phoneNumber";
+"http://tracker.api.gnome.org/ontology/v3/nco#hasEmailAddress";
+"http://tracker.api.gnome.org/ontology/v3/nco#hasPostalAddress";
+"http://tracker.api.gnome.org/ontology/v3/nfo#fileName";
+"http://tracker.api.gnome.org/ontology/v3/nfo#fileLastModified";
+"http://tracker.api.gnome.org/ontology/v3/nmm#artistName";
+"http://tracker.api.gnome.org/ontology/v3/nmm#musicAlbum";
+"http://tracker.api.gnome.org/ontology/v3/nmm#performer";
+"http://tracker.api.gnome.org/ontology/v3/slo#postalAddress";
+"http://tracker.api.gnome.org/ontology/v3/slo#location";
diff --git a/tests/libtracker-data/service/service-var-2.rq b/tests/libtracker-data/service/service-var-2.rq
new file mode 100644
index 000000000..38cfcb753
--- /dev/null
+++ b/tests/libtracker-data/service/service-var-2.rq
@@ -0,0 +1,6 @@
+SELECT ?u {
+  SERVICE ?s {
+    ?u nrl:indexed true
+  }
+}
+VALUES ?s { 'dbus:%s' }
diff --git a/tests/libtracker-data/tracker-service-test.c b/tests/libtracker-data/tracker-service-test.c
index 5dfeb63f5..f2e67e468 100644
--- a/tests/libtracker-data/tracker-service-test.c
+++ b/tests/libtracker-data/tracker-service-test.c
@@ -41,6 +41,8 @@ const TestInfo tests[] = {
        { "service/service-local-filter-1", FALSE },
        { "service/service-union-with-local-1", FALSE },
        { "service/service-union-with-local-2", FALSE },
+       { "service/service-var-1", FALSE },
+       { "service/service-var-2", FALSE },
 };
 
 static GDBusConnection *dbus_conn = NULL;


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