From dd777c54b7585823be1f977e9dd887a5110a74f3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 29 Mar 2023 19:59:47 -0400 Subject: Test URI and blank node manipulation features separately --- .reuse/dep5 | 2 +- test/good/qualify-in.ttl | 3 --- test/good/qualify-out.ttl | 5 ----- test/meson.build | 26 ++++++++++++++++++++++++-- test/prefix/README.md | 4 ++++ test/prefix/manifest.ttl | 20 ++++++++++++++++++++ test/prefix/remove-prefixes.nt | 4 ++++ test/prefix/remove-prefixes.ttl | 7 +++++++ test/qualify/README.md | 4 ++++ test/qualify/manifest.ttl | 20 ++++++++++++++++++++ test/qualify/qualify-in.ttl | 10 ++++++++++ test/qualify/qualify-out.ttl | 10 ++++++++++ test/root/README.md | 5 +++++ test/root/manifest.ttl | 27 +++++++++++++++++++++++++++ test/root/root-inside-base-in.ttl | 23 +++++++++++++++++++++++ test/root/root-inside-base-out.ttl | 23 +++++++++++++++++++++++ test/root/root-outside-base-in.ttl | 23 +++++++++++++++++++++++ test/root/root-outside-base-out.ttl | 23 +++++++++++++++++++++++ 18 files changed, 228 insertions(+), 11 deletions(-) delete mode 100644 test/good/qualify-in.ttl delete mode 100644 test/good/qualify-out.ttl create mode 100644 test/prefix/README.md create mode 100644 test/prefix/manifest.ttl create mode 100644 test/prefix/remove-prefixes.nt create mode 100644 test/prefix/remove-prefixes.ttl create mode 100644 test/qualify/README.md create mode 100644 test/qualify/manifest.ttl create mode 100644 test/qualify/qualify-in.ttl create mode 100644 test/qualify/qualify-out.ttl create mode 100644 test/root/README.md create mode 100644 test/root/manifest.ttl create mode 100644 test/root/root-inside-base-in.ttl create mode 100644 test/root/root-inside-base-out.ttl create mode 100644 test/root/root-outside-base-in.ttl create mode 100644 test/root/root-outside-base-out.ttl diff --git a/.reuse/dep5 b/.reuse/dep5 index e19c6fed..e404aabb 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -8,7 +8,7 @@ Copyright: 2010 World Wide Web Consortium, (MIT, ERCIM, Keio, Beihang) and other Comment: Standard test suites from the W3C (only required for testing) License: BSD-3-Clause -Files: test/bad/* test/good/* test/lax/* test/pretty/* +Files: test/bad/* test/good/* test/lax/* test/qualify/* test/root/* test/prefix/* test/pretty/* Copyright: 2011-2023 David Robillard Comment: Extra tests for serd (potential contributions to the W3C suites) License: BSD-3-Clause OR ISC diff --git a/test/good/qualify-in.ttl b/test/good/qualify-in.ttl deleted file mode 100644 index d938b7bd..00000000 --- a/test/good/qualify-in.ttl +++ /dev/null @@ -1,3 +0,0 @@ -@prefix eg: . - - . diff --git a/test/good/qualify-out.ttl b/test/good/qualify-out.ttl deleted file mode 100644 index 97f67a53..00000000 --- a/test/good/qualify-out.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix eg: . - -eg:s - eg:p eg:o . - diff --git a/test/meson.build b/test/meson.build index 1d126f61..bd027d26 100644 --- a/test/meson.build +++ b/test/meson.build @@ -195,8 +195,19 @@ ns_serdtest = 'http://drobilla.net/sw/serd/test/' ns_w3 = 'http://www.w3.org/2013/' test_suites = { + 'prefix.remove': [ + files('prefix/manifest.ttl'), ns_serdtest + 'prefix/', + '--', '-c', 'test', + ], 'pretty': [ - files('pretty/manifest.ttl'), ns_serdtest + 'pretty/' + files('pretty/manifest.ttl'), ns_serdtest + 'pretty/', + ], + 'qualify': [ + files('qualify/manifest.ttl'), ns_serdtest + 'qualify/', + ], + 'root': [ + files('root/manifest.ttl'), ns_serdtest + 'root/', + '--', '-r', 'http://example.org/top/root/', ], } @@ -226,6 +237,17 @@ if not get_option('tools').disabled() timeout: 240) endforeach + test('good.bulk', run_test_suite, + args: script_args + [ + files('good/manifest.ttl'), + ns_serdtest + 'good/', + '--', + '-b' + ], + is_parallel: false, + suite: ['rdf', 'serd'], + timeout: 240) + ### The lax suite is special because it is run twice... lax_manifest = files('lax/manifest.ttl') lax_base_uri = ns_serdtest + 'lax/' @@ -252,7 +274,7 @@ if not get_option('tools').disabled() manifest = files(syntax + 'Tests' / 'manifest.ttl') base_uri = ns_w3 + syntax + 'Tests/' - args = ['--syntax', syntax, manifest, base_uri] + args = [manifest, base_uri] if syntax == 'TriG' args += ['--', '-a'] endif diff --git a/test/prefix/README.md b/test/prefix/README.md new file mode 100644 index 00000000..56a07244 --- /dev/null +++ b/test/prefix/README.md @@ -0,0 +1,4 @@ +Prefix Test Suite +================= + +This small suite tests adding/chopping prefixes to/from blank node labels. diff --git a/test/prefix/manifest.ttl b/test/prefix/manifest.ttl new file mode 100644 index 00000000..12a0f9ca --- /dev/null +++ b/test/prefix/manifest.ttl @@ -0,0 +1,20 @@ +@prefix mf: . +@prefix rdfs: . +@prefix rdft: . +@prefix serd: . + +<> + a mf:Manifest ; + rdfs:comment "Serd blank node prefixing test suite" ; + mf:entries ( + <#remove-prefixes> + ) . + +<#remove-prefixes> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "remove-prefixes" ; + mf:result . + +rdft:Test + rdfs:subClassOf mf:ManifestEntry . diff --git a/test/prefix/remove-prefixes.nt b/test/prefix/remove-prefixes.nt new file mode 100644 index 00000000..26ac46ee --- /dev/null +++ b/test/prefix/remove-prefixes.nt @@ -0,0 +1,4 @@ +_:s1 _:o1 . +_:s1 _:o3 . +_:s1 _:o4 . +_:b0 _:b1 . diff --git a/test/prefix/remove-prefixes.ttl b/test/prefix/remove-prefixes.ttl new file mode 100644 index 00000000..f3002a59 --- /dev/null +++ b/test/prefix/remove-prefixes.ttl @@ -0,0 +1,7 @@ +_:tests1 + _:testo1 ; + _:testo3 , + _:testo4 . + +_:testb0 + _:testb1 . diff --git a/test/qualify/README.md b/test/qualify/README.md new file mode 100644 index 00000000..c345f242 --- /dev/null +++ b/test/qualify/README.md @@ -0,0 +1,4 @@ +Qualify Test Suite +================== + +This small suite tests qualifying full URIs into shortened forms. diff --git a/test/qualify/manifest.ttl b/test/qualify/manifest.ttl new file mode 100644 index 00000000..0a2fb698 --- /dev/null +++ b/test/qualify/manifest.ttl @@ -0,0 +1,20 @@ +@prefix mf: . +@prefix rdfs: . +@prefix rdft: . +@prefix serd: . + +<> + a mf:Manifest ; + rdfs:comment "Serd URI qualification test suite" ; + mf:entries ( + <#qualify> + ) . + +<#qualify> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "qualify" ; + mf:result . + +rdft:Test + rdfs:subClassOf mf:ManifestEntry . diff --git a/test/qualify/qualify-in.ttl b/test/qualify/qualify-in.ttl new file mode 100644 index 00000000..04afc07f --- /dev/null +++ b/test/qualify/qualify-in.ttl @@ -0,0 +1,10 @@ +@prefix eg: . + + + . + + + . + + + "nil" . diff --git a/test/qualify/qualify-out.ttl b/test/qualify/qualify-out.ttl new file mode 100644 index 00000000..f4dd15d4 --- /dev/null +++ b/test/qualify/qualify-out.ttl @@ -0,0 +1,10 @@ +@prefix eg: . + +eg:s + eg:p eg:o . + + + . + +() + "nil" . diff --git a/test/root/README.md b/test/root/README.md new file mode 100644 index 00000000..bec7db1e --- /dev/null +++ b/test/root/README.md @@ -0,0 +1,5 @@ +Root Test Suite +=============== + +This small suite tests URI resolution against a base URI with or without a +constraining root URI. diff --git a/test/root/manifest.ttl b/test/root/manifest.ttl new file mode 100644 index 00000000..90c6a527 --- /dev/null +++ b/test/root/manifest.ttl @@ -0,0 +1,27 @@ +@prefix mf: . +@prefix rdfs: . +@prefix rdft: . +@prefix serd: . + +<> + a mf:Manifest ; + rdfs:comment "Serd root URI test suite" ; + mf:entries ( + <#root-inside-base> + <#root-outside-base> + ) . + +<#root-inside-base> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "root-inside-base" ; + mf:result . + +<#root-outside-base> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "root-outside-base" ; + mf:result . + +rdft:Test + rdfs:subClassOf mf:ManifestEntry . diff --git a/test/root/root-inside-base-in.ttl b/test/root/root-inside-base-in.ttl new file mode 100644 index 00000000..3fca79ec --- /dev/null +++ b/test/root/root-inside-base-in.ttl @@ -0,0 +1,23 @@ +@base . +@prefix rdfs: . + + + rdfs:label "base node" . + + + rdfs:label "root node" . + + + rdfs:label "within root" . + + + rdfs:label "within base" . + + + rdfs:label "outside base" . + + + rdfs:label "outside domain" . + + + rdfs:label "outside scheme" . diff --git a/test/root/root-inside-base-out.ttl b/test/root/root-inside-base-out.ttl new file mode 100644 index 00000000..a5081e4d --- /dev/null +++ b/test/root/root-inside-base-out.ttl @@ -0,0 +1,23 @@ +@base . +@prefix rdfs: . + + + rdfs:label "base node" . + + + rdfs:label "root node" . + + + rdfs:label "within root" . + + + rdfs:label "within base" . + + + rdfs:label "outside base" . + + + rdfs:label "outside domain" . + + + rdfs:label "outside scheme" . diff --git a/test/root/root-outside-base-in.ttl b/test/root/root-outside-base-in.ttl new file mode 100644 index 00000000..f0c9ef8a --- /dev/null +++ b/test/root/root-outside-base-in.ttl @@ -0,0 +1,23 @@ +@base . +@prefix rdfs: . + + + rdfs:label "base node" . + + + rdfs:label "root node" . + + + rdfs:label "within base" . + + + rdfs:label "within root" . + + + rdfs:label "outside root" . + + + rdfs:label "outside domain" . + + + rdfs:label "outside scheme" . diff --git a/test/root/root-outside-base-out.ttl b/test/root/root-outside-base-out.ttl new file mode 100644 index 00000000..47a4c47e --- /dev/null +++ b/test/root/root-outside-base-out.ttl @@ -0,0 +1,23 @@ +@base . +@prefix rdfs: . + +<> + rdfs:label "base node" . + + + rdfs:label "root node" . + + + rdfs:label "within base" . + +<../s> + rdfs:label "within root" . + +<../../s> + rdfs:label "outside root" . + + + rdfs:label "outside domain" . + + + rdfs:label "outside scheme" . -- cgit v1.2.1