From 08a09191dd69e66aa56822383e84fe034d59dd3f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 3 Apr 2023 09:00:12 -0400 Subject: Separate test suites and simplify licensing metadata --- test/extra/pretty/README.md | 5 + test/extra/pretty/abbreviation.ttl | 57 ++++++ test/extra/pretty/anonymous-in-list-object.ttl | 10 + test/extra/pretty/anonymous-object.ttl | 10 + test/extra/pretty/anonymous-subject-and-object.ttl | 4 + test/extra/pretty/anonymous-subject.ttl | 4 + test/extra/pretty/datatypes.ttl | 15 ++ test/extra/pretty/empty-anonymous-object.ttl | 4 + test/extra/pretty/empty-list-object.ttl | 4 + .../extra/pretty/empty-list-subject-and-object.ttl | 4 + test/extra/pretty/empty-list-subject.ttl | 4 + test/extra/pretty/ext-named-blank.ttl | 11 ++ test/extra/pretty/graph-abbreviation.trig | 65 +++++++ test/extra/pretty/inline-blank-subject.ttl | 5 + test/extra/pretty/inline-blanks-and-lists.ttl | 61 ++++++ test/extra/pretty/inline-list-subject.ttl | 6 + test/extra/pretty/langtags.ttl | 5 + test/extra/pretty/list-in-object.ttl | 10 + test/extra/pretty/list-object.ttl | 8 + test/extra/pretty/list-subject.ttl | 7 + test/extra/pretty/local-name-escapes.ttl | 4 + test/extra/pretty/long-string-escapes.ttl | 4 + test/extra/pretty/long-string-quotes.ttl | 5 + test/extra/pretty/manifest.ttl | 213 +++++++++++++++++++++ test/extra/pretty/many-objects.ttl | 9 + test/extra/pretty/named-graph.trig | 8 + test/extra/pretty/nested-list-object.ttl | 12 ++ test/extra/pretty/nested-list-subject.ttl | 11 ++ test/extra/pretty/relative-uris.ttl | 2 + test/extra/pretty/short-string-escapes.ttl | 4 + test/extra/pretty/uri-escapes.ttl | 2 + 31 files changed, 573 insertions(+) create mode 100644 test/extra/pretty/README.md create mode 100644 test/extra/pretty/abbreviation.ttl create mode 100644 test/extra/pretty/anonymous-in-list-object.ttl create mode 100644 test/extra/pretty/anonymous-object.ttl create mode 100644 test/extra/pretty/anonymous-subject-and-object.ttl create mode 100644 test/extra/pretty/anonymous-subject.ttl create mode 100644 test/extra/pretty/datatypes.ttl create mode 100644 test/extra/pretty/empty-anonymous-object.ttl create mode 100644 test/extra/pretty/empty-list-object.ttl create mode 100644 test/extra/pretty/empty-list-subject-and-object.ttl create mode 100644 test/extra/pretty/empty-list-subject.ttl create mode 100644 test/extra/pretty/ext-named-blank.ttl create mode 100644 test/extra/pretty/graph-abbreviation.trig create mode 100644 test/extra/pretty/inline-blank-subject.ttl create mode 100644 test/extra/pretty/inline-blanks-and-lists.ttl create mode 100644 test/extra/pretty/inline-list-subject.ttl create mode 100644 test/extra/pretty/langtags.ttl create mode 100644 test/extra/pretty/list-in-object.ttl create mode 100644 test/extra/pretty/list-object.ttl create mode 100644 test/extra/pretty/list-subject.ttl create mode 100644 test/extra/pretty/local-name-escapes.ttl create mode 100644 test/extra/pretty/long-string-escapes.ttl create mode 100644 test/extra/pretty/long-string-quotes.ttl create mode 100644 test/extra/pretty/manifest.ttl create mode 100644 test/extra/pretty/many-objects.ttl create mode 100644 test/extra/pretty/named-graph.trig create mode 100644 test/extra/pretty/nested-list-object.ttl create mode 100644 test/extra/pretty/nested-list-subject.ttl create mode 100644 test/extra/pretty/relative-uris.ttl create mode 100644 test/extra/pretty/short-string-escapes.ttl create mode 100644 test/extra/pretty/uri-escapes.ttl (limited to 'test/extra/pretty') diff --git a/test/extra/pretty/README.md b/test/extra/pretty/README.md new file mode 100644 index 00000000..361d9491 --- /dev/null +++ b/test/extra/pretty/README.md @@ -0,0 +1,5 @@ +Pretty Test Suite +================= + +This suite contains single-file tests that can be read and rewritten in the +same syntax, exactly reproducing the input byte-for-byte. diff --git a/test/extra/pretty/abbreviation.ttl b/test/extra/pretty/abbreviation.ttl new file mode 100644 index 00000000..bf46f6d5 --- /dev/null +++ b/test/extra/pretty/abbreviation.ttl @@ -0,0 +1,57 @@ +@prefix eg: . + +eg:s1 + eg:b eg:c , + eg:d , + eg:e ; + eg:f eg:g , + eg:h ; + eg:i eg:j ; + eg:k eg:l . + +eg:s2 + a eg:Thing ; + eg:p1 eg:o1 , + [ + a eg:SubThing ; + eg:p2 eg:o2 + ] , [ + a eg:OtherSubThing ; + eg:p3 eg:o3 + ] ; + eg:p4 eg:o4 . + +eg:s3 + eg:resource eg:Blank . + +eg:s4 + eg:anon [] . + +eg:s5 + eg:blank [ + eg:nestedEmptyBlank [] ; + eg:nestedNonEmptyBlanks [ + eg:value 1 + ] , [ + eg:value 2 + ] + ] ; + eg:listOfNumbers ( + 3 + 4 + ) . + +eg:s6 + eg:listOfNumbers ( + 5 + 6 + ) . + +eg:s7 + eg:listOfResources ( + [ + eg:value 7 + ] [ + eg:value 8 + ] + ) . diff --git a/test/extra/pretty/anonymous-in-list-object.ttl b/test/extra/pretty/anonymous-in-list-object.ttl new file mode 100644 index 00000000..4f135e29 --- /dev/null +++ b/test/extra/pretty/anonymous-in-list-object.ttl @@ -0,0 +1,10 @@ +@prefix eg: . + +eg:s + eg:p ( + [ + a eg:Spy + ] [ + a eg:Ninja + ] + ) . diff --git a/test/extra/pretty/anonymous-object.ttl b/test/extra/pretty/anonymous-object.ttl new file mode 100644 index 00000000..f592fed1 --- /dev/null +++ b/test/extra/pretty/anonymous-object.ttl @@ -0,0 +1,10 @@ +@prefix eg: . + +eg:s + eg:p1 [ + eg:p2 eg:o2 ; + eg:p3 eg:o3 + ] , [ + eg:p4 eg:o4 ; + eg:p5 eg:o5 + ] . diff --git a/test/extra/pretty/anonymous-subject-and-object.ttl b/test/extra/pretty/anonymous-subject-and-object.ttl new file mode 100644 index 00000000..8904cca6 --- /dev/null +++ b/test/extra/pretty/anonymous-subject-and-object.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +[] + eg:p [] . diff --git a/test/extra/pretty/anonymous-subject.ttl b/test/extra/pretty/anonymous-subject.ttl new file mode 100644 index 00000000..e0e467e2 --- /dev/null +++ b/test/extra/pretty/anonymous-subject.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +[] + eg:p eg:o . diff --git a/test/extra/pretty/datatypes.ttl b/test/extra/pretty/datatypes.ttl new file mode 100644 index 00000000..721dfe4d --- /dev/null +++ b/test/extra/pretty/datatypes.ttl @@ -0,0 +1,15 @@ +@prefix eg: . +@prefix xsd: . + +eg:s + eg:p -1.2 , + "-3."^^xsd:decimal , + -4 , + 0 , + 1 , + 2.3 , + "4."^^xsd:decimal , + false , + true , + "x"^^eg:datatype , + "y"^^ . diff --git a/test/extra/pretty/empty-anonymous-object.ttl b/test/extra/pretty/empty-anonymous-object.ttl new file mode 100644 index 00000000..f3b8d7f7 --- /dev/null +++ b/test/extra/pretty/empty-anonymous-object.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +eg:s + eg:p [] . diff --git a/test/extra/pretty/empty-list-object.ttl b/test/extra/pretty/empty-list-object.ttl new file mode 100644 index 00000000..b4045ec0 --- /dev/null +++ b/test/extra/pretty/empty-list-object.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +eg:s + eg:list () . diff --git a/test/extra/pretty/empty-list-subject-and-object.ttl b/test/extra/pretty/empty-list-subject-and-object.ttl new file mode 100644 index 00000000..3b84980e --- /dev/null +++ b/test/extra/pretty/empty-list-subject-and-object.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +() + eg:list () . diff --git a/test/extra/pretty/empty-list-subject.ttl b/test/extra/pretty/empty-list-subject.ttl new file mode 100644 index 00000000..0610eb07 --- /dev/null +++ b/test/extra/pretty/empty-list-subject.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +() + a eg:ExampleList . diff --git a/test/extra/pretty/ext-named-blank.ttl b/test/extra/pretty/ext-named-blank.ttl new file mode 100644 index 00000000..807d6313 --- /dev/null +++ b/test/extra/pretty/ext-named-blank.ttl @@ -0,0 +1,11 @@ +@prefix eg: . + +eg:s + eg:p1 [ + == ; + eg:name "object" + ] ; + eg:p2 [ + == eg:o ; + eg:name "o" + ] . diff --git a/test/extra/pretty/graph-abbreviation.trig b/test/extra/pretty/graph-abbreviation.trig new file mode 100644 index 00000000..8ec75f6e --- /dev/null +++ b/test/extra/pretty/graph-abbreviation.trig @@ -0,0 +1,65 @@ +@prefix : . +@prefix rdf: . + +:graph { + :a + :b :c , + :d , + :e ; + :f :g , + :h ; + :i :j ; + :k :l . + + :s + a :Thing ; + :p1 :o1 , + [ + a :SubThing ; + :p2 :o2 + ] , [ + a :OtherSubThing ; + :p3 :o3 + ] ; + :p4 :o4 . + + [] + :isA :Blank . + + [] + :sameAs [] . + + [] + :blank [ + :nestedEmptyBlank [] ; + :nestedNonEmptyBlanks [ + rdf:value 1 + ] , [ + rdf:value 2 + ] + ] ; + :lists ( + 3 + 4 + ) . + + [] + :lists ( + 5 + 6 + ) . + + [] + :lists ( + [ + rdf:value 7 + ] [ + rdf:value 8 + ] + ) . +} + +:separateGraph { + :m + a :OtherThing . +} diff --git a/test/extra/pretty/inline-blank-subject.ttl b/test/extra/pretty/inline-blank-subject.ttl new file mode 100644 index 00000000..8f5de39c --- /dev/null +++ b/test/extra/pretty/inline-blank-subject.ttl @@ -0,0 +1,5 @@ +@prefix eg: . + +[ + a eg:BlankSubject +] eg:isA eg:Blank . diff --git a/test/extra/pretty/inline-blanks-and-lists.ttl b/test/extra/pretty/inline-blanks-and-lists.ttl new file mode 100644 index 00000000..c57482d3 --- /dev/null +++ b/test/extra/pretty/inline-blanks-and-lists.ttl @@ -0,0 +1,61 @@ +@prefix eg: . + +[ + a eg:TopBlank +] . + +[ + a [] +] . + +[ + a () +] . + +[] + a [] , + [] . + +[] + a [] , + () . + +[] + a () , + [] . + +[] + a () , + () . + +eg:s2 + a eg:SparseThing , + [] , + () , + [] , + [] , + () , + () , + , + [] , + , + () , + , + [] , + eg:o21 , + [] , + eg:o22 , + () , + eg:o23 . + +eg:s3 + a eg:Thing ; + eg:p1 eg:o1 , + [ + a eg:SubThing ; + eg:p2 eg:o2 + ] , [ + a eg:OtherSubThing ; + eg:p3 eg:o3 + ] ; + eg:p4 eg:o4 . diff --git a/test/extra/pretty/inline-list-subject.ttl b/test/extra/pretty/inline-list-subject.ttl new file mode 100644 index 00000000..a3f8ac18 --- /dev/null +++ b/test/extra/pretty/inline-list-subject.ttl @@ -0,0 +1,6 @@ +@prefix eg: . + +( + eg:item1 + eg:item2 +) eg:isA eg:List . diff --git a/test/extra/pretty/langtags.ttl b/test/extra/pretty/langtags.ttl new file mode 100644 index 00000000..29d7e2d4 --- /dev/null +++ b/test/extra/pretty/langtags.ttl @@ -0,0 +1,5 @@ +@prefix eg: . + +eg:s + eg:p "eh?"@en-ca , + "hä?"@de . diff --git a/test/extra/pretty/list-in-object.ttl b/test/extra/pretty/list-in-object.ttl new file mode 100644 index 00000000..ce887157 --- /dev/null +++ b/test/extra/pretty/list-in-object.ttl @@ -0,0 +1,10 @@ +@prefix eg: . + +eg:s + eg:p [ + eg:list ( + "apple" + "banana" + "cherry" + ) + ] . diff --git a/test/extra/pretty/list-object.ttl b/test/extra/pretty/list-object.ttl new file mode 100644 index 00000000..735d9df6 --- /dev/null +++ b/test/extra/pretty/list-object.ttl @@ -0,0 +1,8 @@ +@prefix eg: . + +eg:s + eg:list ( + "apple" + "banana" + "cherry" + ) . diff --git a/test/extra/pretty/list-subject.ttl b/test/extra/pretty/list-subject.ttl new file mode 100644 index 00000000..927f56f3 --- /dev/null +++ b/test/extra/pretty/list-subject.ttl @@ -0,0 +1,7 @@ +@prefix eg: . + +( + "apple" + "banana" + "cherry" +) a eg:ExampleList . diff --git a/test/extra/pretty/local-name-escapes.ttl b/test/extra/pretty/local-name-escapes.ttl new file mode 100644 index 00000000..91c3905d --- /dev/null +++ b/test/extra/pretty/local-name-escapes.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +eg:s + eg:p eg:local\'\!\#\$\%\&\(\)\*\+\,\/\;\=\?\@\~ . diff --git a/test/extra/pretty/long-string-escapes.ttl b/test/extra/pretty/long-string-escapes.ttl new file mode 100644 index 00000000..435e3d1a --- /dev/null +++ b/test/extra/pretty/long-string-escapes.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +eg:s + eg:p """\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b \u000B \u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F"'\\\u007F""" . diff --git a/test/extra/pretty/long-string-quotes.ttl b/test/extra/pretty/long-string-quotes.ttl new file mode 100644 index 00000000..aceaecda --- /dev/null +++ b/test/extra/pretty/long-string-quotes.ttl @@ -0,0 +1,5 @@ +@prefix eg: . + +eg:s + eg:p1 """Unescaped "quotes" within""" ; + eg:p2 """Trickier ""\"case""\"""" . diff --git a/test/extra/pretty/manifest.ttl b/test/extra/pretty/manifest.ttl new file mode 100644 index 00000000..69b951af --- /dev/null +++ b/test/extra/pretty/manifest.ttl @@ -0,0 +1,213 @@ +@prefix mf: . +@prefix rdfs: . +@prefix rdft: . +@prefix serd: . + +<> + a mf:Manifest ; + rdfs:comment "Serd pretty-printing test suite" ; + mf:entries ( + <#abbreviation> + <#anonymous-in-list-object> + <#anonymous-object> + <#anonymous-subject> + <#anonymous-subject-and-object> + <#datatypes> + <#empty-anonymous-object> + <#empty-list-object> + <#empty-list-subject> + <#empty-list-subject-and-object> + <#ext-named-blank> + <#graph-abbreviation> + <#inline-blank-subject> + <#inline-blanks-and-lists> + <#inline-list-subject> + <#langtags> + <#list-in-object> + <#list-object> + <#list-subject> + <#local-name-escapes> + <#long-string-escapes> + <#long-string-quotes> + <#many-objects> + <#named-graph> + <#nested-list-object> + <#relative-uris> + <#short-string-escapes> + <#uri-escapes> + <#nested-list-subject> + ) . + +<#abbreviation> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "abbreviation" ; + mf:result . + +<#anonymous-in-list-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "anonymous-in-list-object" ; + mf:result . + +<#anonymous-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "anonymous-object" ; + mf:result . + +<#anonymous-subject> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "anonymous-subject" ; + mf:result . + +<#anonymous-subject-and-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "anonymous-subject-and-object" ; + mf:result . + +<#datatypes> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "datatypes" ; + mf:result . + +<#empty-anonymous-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "empty-anonymous-object" ; + mf:result . + +<#empty-list-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "empty-list-object" ; + mf:result . + +<#empty-list-subject> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "empty-list-subject" ; + mf:result . + +<#empty-list-subject-and-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "empty-list-subject-and-object" ; + mf:result . + +<#ext-named-blank> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "ext-named-blank" ; + mf:result . + +<#graph-abbreviation> + a rdft:TestTrigEval ; + mf:action ; + mf:name "graph-abbreviation" ; + mf:result . + +<#inline-blank-subject> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "inline-blank-subject" ; + mf:result . + +<#inline-blanks-and-lists> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "inline-blanks-and-lists" ; + mf:result . + +<#inline-list-subject> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "inline-list-subject" ; + mf:result . + +<#langtags> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "langtags" ; + mf:result . + +<#list-in-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "list-in-object" ; + mf:result . + +<#list-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "list-object" ; + mf:result . + +<#list-subject> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "list-subject" ; + mf:result . + +<#local-name-escapes> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "local-name-escapes" ; + mf:result . + +<#long-string-escapes> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "long-string-escapes" ; + mf:result . + +<#long-string-quotes> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "long-string-quotes" ; + mf:result . + +<#many-objects> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "many-objects" ; + mf:result . + +<#named-graph> + a rdft:TestTrigEval ; + mf:action ; + mf:name "named-graph" ; + mf:result . + +<#nested-list-object> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "nested-list-object" ; + mf:result . + +<#nested-list-subject> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "nested-list-subject" ; + mf:result . + +<#relative-uris> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "relative-uris" ; + mf:result . + +<#short-string-escapes> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "short-string-escapes" ; + mf:result . + +<#uri-escapes> + a rdft:TestTurtleEval ; + mf:action ; + mf:name "uri-escapes" ; + mf:result . diff --git a/test/extra/pretty/many-objects.ttl b/test/extra/pretty/many-objects.ttl new file mode 100644 index 00000000..534741dd --- /dev/null +++ b/test/extra/pretty/many-objects.ttl @@ -0,0 +1,9 @@ +@prefix eg: . + +eg:s + eg:p1 "apple" , + "banana" , + "cherry" ; + eg:p2 "asparagus" , + "beet" , + "carrot" . diff --git a/test/extra/pretty/named-graph.trig b/test/extra/pretty/named-graph.trig new file mode 100644 index 00000000..5cd12f3b --- /dev/null +++ b/test/extra/pretty/named-graph.trig @@ -0,0 +1,8 @@ +@prefix eg: . + +eg:g { + eg:s + eg:p [ + a eg:Object + ] . +} diff --git a/test/extra/pretty/nested-list-object.ttl b/test/extra/pretty/nested-list-object.ttl new file mode 100644 index 00000000..d2177ba3 --- /dev/null +++ b/test/extra/pretty/nested-list-object.ttl @@ -0,0 +1,12 @@ +@prefix eg: . + +eg:s + eg:list ( + ( + eg:l1e1 + eg:l1e2 + ) ( + eg:l2e1 + eg:l2e2 + ) + ) . diff --git a/test/extra/pretty/nested-list-subject.ttl b/test/extra/pretty/nested-list-subject.ttl new file mode 100644 index 00000000..128197c0 --- /dev/null +++ b/test/extra/pretty/nested-list-subject.ttl @@ -0,0 +1,11 @@ +@prefix eg: . + +( + ( + eg:l1e1 + eg:l1e2 + ) ( + eg:l2e1 + eg:l2e2 + ) +) a eg:ExampleList . diff --git a/test/extra/pretty/relative-uris.ttl b/test/extra/pretty/relative-uris.ttl new file mode 100644 index 00000000..397c7cf7 --- /dev/null +++ b/test/extra/pretty/relative-uris.ttl @@ -0,0 +1,2 @@ + + . diff --git a/test/extra/pretty/short-string-escapes.ttl b/test/extra/pretty/short-string-escapes.ttl new file mode 100644 index 00000000..0665e814 --- /dev/null +++ b/test/extra/pretty/short-string-escapes.ttl @@ -0,0 +1,4 @@ +@prefix eg: . + +eg:s + eg:p "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\u000B\f\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\\\u007F" . diff --git a/test/extra/pretty/uri-escapes.ttl b/test/extra/pretty/uri-escapes.ttl new file mode 100644 index 00000000..09ced38a --- /dev/null +++ b/test/extra/pretty/uri-escapes.ttl @@ -0,0 +1,2 @@ + + . -- cgit v1.2.1