[tracker/wip/carlosg/sparql1.1: 107/113] tests: Add tests for rdf:langString, LANGMATCHES, and STRLANG
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/sparql1.1: 107/113] tests: Add tests for rdf:langString, LANGMATCHES, and STRLANG
- Date: Sun, 21 Jul 2019 14:38:13 +0000 (UTC)
commit 3de24a9795acf672769099d0a6dff4f8915b4167
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Jul 20 23:42:49 2019 +0200
tests: Add tests for rdf:langString, LANGMATCHES, and STRLANG
tests/libtracker-data/langstring/data.rq | 16 ++++++++++++++++
tests/libtracker-data/langstring/langmatches.out | 2 ++
tests/libtracker-data/langstring/langmatches.rq | 1 +
.../libtracker-data/langstring/match-non-langstring.out | 1 +
tests/libtracker-data/langstring/match-non-langstring.rq | 1 +
.../libtracker-data/langstring/match-with-langstring.out | 1 +
.../libtracker-data/langstring/match-with-langstring.rq | 1 +
.../langstring/match-with-non-langstring.out | 1 +
.../langstring/match-with-non-langstring.rq | 1 +
tests/libtracker-data/langstring/strlang.out | 1 +
tests/libtracker-data/langstring/strlang.rq | 1 +
tests/libtracker-data/tracker-sparql-test.c | 5 +++++
12 files changed, 32 insertions(+)
---
diff --git a/tests/libtracker-data/langstring/data.rq b/tests/libtracker-data/langstring/data.rq
new file mode 100644
index 000000000..ae71299ea
--- /dev/null
+++ b/tests/libtracker-data/langstring/data.rq
@@ -0,0 +1,16 @@
+INSERT {
+ <a> a example:A ;
+ example:langString "foo"@en ;
+ example:string "bar" .
+
+ <b> a example:A ;
+ example:langString "foo"@fr ;
+ example:string "baz" .
+
+ <c> a example:A ;
+ example:langString "foo" ;
+ example:string "bla"@es .
+
+ <d> a example:A ;
+ example:langString "bleh"@en .
+}
diff --git a/tests/libtracker-data/langstring/langmatches.out
b/tests/libtracker-data/langstring/langmatches.out
new file mode 100644
index 000000000..22d3c21b7
--- /dev/null
+++ b/tests/libtracker-data/langstring/langmatches.out
@@ -0,0 +1,2 @@
+"a"
+"d"
diff --git a/tests/libtracker-data/langstring/langmatches.rq b/tests/libtracker-data/langstring/langmatches.rq
new file mode 100644
index 000000000..d8c693b37
--- /dev/null
+++ b/tests/libtracker-data/langstring/langmatches.rq
@@ -0,0 +1 @@
+SELECT ?u { ?u example:langString ?s . FILTER (LANGMATCHES (?s, "en")) } order by ?u
\ No newline at end of file
diff --git a/tests/libtracker-data/langstring/match-non-langstring.out
b/tests/libtracker-data/langstring/match-non-langstring.out
new file mode 100644
index 000000000..cdf158597
--- /dev/null
+++ b/tests/libtracker-data/langstring/match-non-langstring.out
@@ -0,0 +1 @@
+"c"
diff --git a/tests/libtracker-data/langstring/match-non-langstring.rq
b/tests/libtracker-data/langstring/match-non-langstring.rq
new file mode 100644
index 000000000..8d4283d89
--- /dev/null
+++ b/tests/libtracker-data/langstring/match-non-langstring.rq
@@ -0,0 +1 @@
+SELECT ?u { ?u example:string "bla"@es }
diff --git a/tests/libtracker-data/langstring/match-with-langstring.out
b/tests/libtracker-data/langstring/match-with-langstring.out
new file mode 100644
index 000000000..231f150c5
--- /dev/null
+++ b/tests/libtracker-data/langstring/match-with-langstring.out
@@ -0,0 +1 @@
+"a"
diff --git a/tests/libtracker-data/langstring/match-with-langstring.rq
b/tests/libtracker-data/langstring/match-with-langstring.rq
new file mode 100644
index 000000000..ff2951875
--- /dev/null
+++ b/tests/libtracker-data/langstring/match-with-langstring.rq
@@ -0,0 +1 @@
+SELECT ?u { ?u example:langString "foo"@en }
diff --git a/tests/libtracker-data/langstring/match-with-non-langstring.out
b/tests/libtracker-data/langstring/match-with-non-langstring.out
new file mode 100644
index 000000000..cdf158597
--- /dev/null
+++ b/tests/libtracker-data/langstring/match-with-non-langstring.out
@@ -0,0 +1 @@
+"c"
diff --git a/tests/libtracker-data/langstring/match-with-non-langstring.rq
b/tests/libtracker-data/langstring/match-with-non-langstring.rq
new file mode 100644
index 000000000..3ceef7b28
--- /dev/null
+++ b/tests/libtracker-data/langstring/match-with-non-langstring.rq
@@ -0,0 +1 @@
+SELECT ?u { ?u example:langString "foo" }
diff --git a/tests/libtracker-data/langstring/strlang.out b/tests/libtracker-data/langstring/strlang.out
new file mode 100644
index 000000000..231f150c5
--- /dev/null
+++ b/tests/libtracker-data/langstring/strlang.out
@@ -0,0 +1 @@
+"a"
diff --git a/tests/libtracker-data/langstring/strlang.rq b/tests/libtracker-data/langstring/strlang.rq
new file mode 100644
index 000000000..712ae6461
--- /dev/null
+++ b/tests/libtracker-data/langstring/strlang.rq
@@ -0,0 +1 @@
+SELECT ?u { ?u example:langString ?s . FILTER (?s = STRLANG ("foo", "en")) }
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 5c60e75ad..b865f19c0 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -153,6 +153,11 @@ const TestInfo tests[] = {
{ "graph/add-into-self", "graph/data-add-into-self", FALSE },
{ "graph/add-from-default", "graph/data-add-from-default", FALSE },
{ "graph/add-to-default", "graph/data-add-to-default", FALSE },
+ { "langstring/match-with-non-langstring", "langstring/data", FALSE },
+ { "langstring/match-with-langstring", "langstring/data", FALSE },
+ { "langstring/match-non-langstring", "langstring/data", FALSE },
+ { "langstring/langmatches", "langstring/data", FALSE },
+ { "langstring/strlang", "langstring/data", FALSE },
{ "optional/q-opt-complex-1", "optional/complex-data-1", FALSE },
{ "optional/simple-optional-triple", "optional/simple-optional-triple", FALSE },
{ "regex/regex-query-001", "regex/regex-data-01", FALSE },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]