From 1c082131014e579b587f8bb8b89f3c999e22f4ed Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 3 Apr 2023 09:00:18 -0400 Subject: Add a simple abbreviation test suite --- test/extra/abbreviate/README.md | 6 ++++++ test/extra/abbreviate/collapse-graphs.nq | 6 ++++++ test/extra/abbreviate/collapse-graphs.trig | 18 ++++++++++++++++ test/extra/abbreviate/collapse-predicates.nt | 6 ++++++ test/extra/abbreviate/collapse-predicates.ttl | 7 ++++++ test/extra/abbreviate/collapse-subjects.nt | 6 ++++++ test/extra/abbreviate/collapse-subjects.ttl | 11 ++++++++++ test/extra/abbreviate/manifest.ttl | 31 +++++++++++++++++++++++++++ test/meson.build | 3 +++ 9 files changed, 94 insertions(+) create mode 100644 test/extra/abbreviate/README.md create mode 100644 test/extra/abbreviate/collapse-graphs.nq create mode 100644 test/extra/abbreviate/collapse-graphs.trig create mode 100644 test/extra/abbreviate/collapse-predicates.nt create mode 100644 test/extra/abbreviate/collapse-predicates.ttl create mode 100644 test/extra/abbreviate/collapse-subjects.nt create mode 100644 test/extra/abbreviate/collapse-subjects.ttl create mode 100644 test/extra/abbreviate/manifest.ttl diff --git a/test/extra/abbreviate/README.md b/test/extra/abbreviate/README.md new file mode 100644 index 00000000..ac887dc1 --- /dev/null +++ b/test/extra/abbreviate/README.md @@ -0,0 +1,6 @@ +Abbreviate Test Suite +===================== + +This suite tests abbreviating "flat" NTriples/NQuads input by eliding subjects +or predicates in Turtle/Trig. Pretty-printing is more limited here since there +is no context information to determine if blank nodes are anonymous. diff --git a/test/extra/abbreviate/collapse-graphs.nq b/test/extra/abbreviate/collapse-graphs.nq new file mode 100644 index 00000000..40ccc7f9 --- /dev/null +++ b/test/extra/abbreviate/collapse-graphs.nq @@ -0,0 +1,6 @@ + . + . + . + . + . + . diff --git a/test/extra/abbreviate/collapse-graphs.trig b/test/extra/abbreviate/collapse-graphs.trig new file mode 100644 index 00000000..5bdf55ce --- /dev/null +++ b/test/extra/abbreviate/collapse-graphs.trig @@ -0,0 +1,18 @@ + + { + + ; + ; + . +} + + { + + . +} + + { + + ; + . +} diff --git a/test/extra/abbreviate/collapse-predicates.nt b/test/extra/abbreviate/collapse-predicates.nt new file mode 100644 index 00000000..b1128902 --- /dev/null +++ b/test/extra/abbreviate/collapse-predicates.nt @@ -0,0 +1,6 @@ + . + . + . + . + . + . diff --git a/test/extra/abbreviate/collapse-predicates.ttl b/test/extra/abbreviate/collapse-predicates.ttl new file mode 100644 index 00000000..a0bbd881 --- /dev/null +++ b/test/extra/abbreviate/collapse-predicates.ttl @@ -0,0 +1,7 @@ + + , + , + ; + ; + , + . diff --git a/test/extra/abbreviate/collapse-subjects.nt b/test/extra/abbreviate/collapse-subjects.nt new file mode 100644 index 00000000..fa5fd630 --- /dev/null +++ b/test/extra/abbreviate/collapse-subjects.nt @@ -0,0 +1,6 @@ + . + . + . + . + . + . diff --git a/test/extra/abbreviate/collapse-subjects.ttl b/test/extra/abbreviate/collapse-subjects.ttl new file mode 100644 index 00000000..b1c86f59 --- /dev/null +++ b/test/extra/abbreviate/collapse-subjects.ttl @@ -0,0 +1,11 @@ + + ; + ; + . + + + . + + + ; + . diff --git a/test/extra/abbreviate/manifest.ttl b/test/extra/abbreviate/manifest.ttl new file mode 100644 index 00000000..ddcfdf03 --- /dev/null +++ b/test/extra/abbreviate/manifest.ttl @@ -0,0 +1,31 @@ +@prefix mf: . +@prefix rdfs: . +@prefix rdft: . +@prefix serd: . + +<> + a mf:Manifest ; + rdfs:comment "Serd abbreviation test cases" ; + mf:entries ( + <#collapse-graphs> + <#collapse-predicates> + <#collapse-subjects> + ) . + +<#collapse-graphs> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "collapse-graphs" ; + mf:result . + +<#collapse-predicates> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "collapse-predicates" ; + mf:result . + +<#collapse-subjects> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "collapse-subjects" ; + mf:result . diff --git a/test/meson.build b/test/meson.build index 2d21456b..45173690 100644 --- a/test/meson.build +++ b/test/meson.build @@ -211,6 +211,9 @@ test_suites = { files('w3c/TurtleTests/manifest.ttl'), ns_w3 + 'TurtleTests/', '--', '-a', '-i', 'Turtle', ], + 'abbreviate': [ + files('extra/abbreviate/manifest.ttl'), ns_serdtest + 'abbreviate/', + ], 'bad': [ files('extra/bad/manifest.ttl'), ns_serdtest + 'bad/', ], -- cgit v1.2.1