From 460e694dcfefbb94f028fa01861c817e0362aa15 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 4 May 2022 23:35:27 +0200 Subject: tests: Add FTS tests for partial updates and INSERT OR REPLACE changes Test paths fixed by the previous commits. --- tests/fts/consistency/insert-or-replace-1.out | 1 + tests/fts/consistency/insert-or-replace-1.rq | 1 + tests/fts/consistency/insert-or-replace-2.out | 0 tests/fts/consistency/insert-or-replace-2.rq | 1 + tests/fts/consistency/insert-or-replace-data.rq | 7 +++++++ tests/fts/consistency/partial-update-1.out | 0 tests/fts/consistency/partial-update-1.rq | 1 + tests/fts/consistency/partial-update-2.out | 1 + tests/fts/consistency/partial-update-2.rq | 1 + tests/fts/consistency/partial-update-data.rq | 11 +++++++++++ tests/fts/tracker-fts-test.c | 2 ++ 11 files changed, 26 insertions(+) create mode 100644 tests/fts/consistency/insert-or-replace-1.out create mode 100644 tests/fts/consistency/insert-or-replace-1.rq create mode 100644 tests/fts/consistency/insert-or-replace-2.out create mode 100644 tests/fts/consistency/insert-or-replace-2.rq create mode 100644 tests/fts/consistency/insert-or-replace-data.rq create mode 100644 tests/fts/consistency/partial-update-1.out create mode 100644 tests/fts/consistency/partial-update-1.rq create mode 100644 tests/fts/consistency/partial-update-2.out create mode 100644 tests/fts/consistency/partial-update-2.rq create mode 100644 tests/fts/consistency/partial-update-data.rq (limited to 'tests') diff --git a/tests/fts/consistency/insert-or-replace-1.out b/tests/fts/consistency/insert-or-replace-1.out new file mode 100644 index 000000000..db6765d23 --- /dev/null +++ b/tests/fts/consistency/insert-or-replace-1.out @@ -0,0 +1 @@ +"http://www.example.org/test#1" diff --git a/tests/fts/consistency/insert-or-replace-1.rq b/tests/fts/consistency/insert-or-replace-1.rq new file mode 100644 index 000000000..794ae3ea4 --- /dev/null +++ b/tests/fts/consistency/insert-or-replace-1.rq @@ -0,0 +1 @@ +SELECT ?u { ?u fts:match 'two' } diff --git a/tests/fts/consistency/insert-or-replace-2.out b/tests/fts/consistency/insert-or-replace-2.out new file mode 100644 index 000000000..e69de29bb diff --git a/tests/fts/consistency/insert-or-replace-2.rq b/tests/fts/consistency/insert-or-replace-2.rq new file mode 100644 index 000000000..8223fa858 --- /dev/null +++ b/tests/fts/consistency/insert-or-replace-2.rq @@ -0,0 +1 @@ +SELECT ?u { ?u fts:match 'one' } diff --git a/tests/fts/consistency/insert-or-replace-data.rq b/tests/fts/consistency/insert-or-replace-data.rq new file mode 100644 index 000000000..3101faf81 --- /dev/null +++ b/tests/fts/consistency/insert-or-replace-data.rq @@ -0,0 +1,7 @@ +INSERT OR REPLACE { + test:1 a test:A ; test:p "one" . +}; + +INSERT OR REPLACE { + test:1 a test:A ; test:p "two" . +}; diff --git a/tests/fts/consistency/partial-update-1.out b/tests/fts/consistency/partial-update-1.out new file mode 100644 index 000000000..e69de29bb diff --git a/tests/fts/consistency/partial-update-1.rq b/tests/fts/consistency/partial-update-1.rq new file mode 100644 index 000000000..66b5311dd --- /dev/null +++ b/tests/fts/consistency/partial-update-1.rq @@ -0,0 +1 @@ +SELECT ?u { ?u fts:match "two" } diff --git a/tests/fts/consistency/partial-update-2.out b/tests/fts/consistency/partial-update-2.out new file mode 100644 index 000000000..db6765d23 --- /dev/null +++ b/tests/fts/consistency/partial-update-2.out @@ -0,0 +1 @@ +"http://www.example.org/test#1" diff --git a/tests/fts/consistency/partial-update-2.rq b/tests/fts/consistency/partial-update-2.rq new file mode 100644 index 000000000..6e4c74daa --- /dev/null +++ b/tests/fts/consistency/partial-update-2.rq @@ -0,0 +1 @@ +select ?u { ?u fts:match 'three' } diff --git a/tests/fts/consistency/partial-update-data.rq b/tests/fts/consistency/partial-update-data.rq new file mode 100644 index 000000000..25b172a9e --- /dev/null +++ b/tests/fts/consistency/partial-update-data.rq @@ -0,0 +1,11 @@ +INSERT DATA { + test:1 a test:A ; test:p "one" ; test:q "two" . +}; + +DELETE DATA { + test:1 test:q "two" . +} + +INSERT DATA { + test:1 test:q "three" . +}; diff --git a/tests/fts/tracker-fts-test.c b/tests/fts/tracker-fts-test.c index baffbc3b4..b05da1aee 100644 --- a/tests/fts/tracker-fts-test.c +++ b/tests/fts/tracker-fts-test.c @@ -35,6 +35,8 @@ struct _TestInfo { const TestInfo tests[] = { { "fts3aa", 3 }, { "fts3ae", 1 }, + { "consistency/partial-update", 2 }, + { "consistency/insert-or-replace", 2 }, { "prefix/fts3prefix", 3 }, { "limits/fts3limits", 4 }, { "input/fts3input", 3 }, -- cgit v1.2.1