diff options
author | David Robillard <d@drobilla.net> | 2023-04-01 19:20:23 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:08 -0500 |
commit | c9afaab2a84f592e4567b37b3551511381e734e4 (patch) | |
tree | 414c77e7b41c222e9237d76add5c1c4944079ebd /test | |
parent | 3cc5a4fcaea8f1e2fd47c53135b53f8edcb8619d (diff) | |
download | serd-c9afaab2a84f592e4567b37b3551511381e734e4.tar.gz serd-c9afaab2a84f592e4567b37b3551511381e734e4.tar.bz2 serd-c9afaab2a84f592e4567b37b3551511381e734e4.zip |
Add "longhand" mode to write rdf:type predicates normally
Diffstat (limited to 'test')
-rw-r--r-- | test/extra/longhand/blank_object.ttl | 2 | ||||
-rw-r--r-- | test/extra/longhand/blank_subject.ttl | 2 | ||||
-rw-r--r-- | test/extra/longhand/collection_object.ttl | 2 | ||||
-rw-r--r-- | test/extra/longhand/collection_subject.ttl | 2 | ||||
-rw-r--r-- | test/extra/longhand/longhand.ttl | 13 | ||||
-rw-r--r-- | test/extra/longhand/manifest.ttl | 16 | ||||
-rw-r--r-- | test/extra/longhand/shorthand.ttl | 13 | ||||
-rw-r--r-- | test/meson.build | 11 |
8 files changed, 61 insertions, 0 deletions
diff --git a/test/extra/longhand/blank_object.ttl b/test/extra/longhand/blank_object.ttl new file mode 100644 index 00000000..270e406b --- /dev/null +++ b/test/extra/longhand/blank_object.ttl @@ -0,0 +1,2 @@ +@prefix eg: <http://example.org/> . +eg:s eg:p1 [ eg:p11 1 ; eg:p12 2 ] ; eg:p2 [ eg:p23 3 ; eg:p24 4 ] . diff --git a/test/extra/longhand/blank_subject.ttl b/test/extra/longhand/blank_subject.ttl new file mode 100644 index 00000000..5e3303f9 --- /dev/null +++ b/test/extra/longhand/blank_subject.ttl @@ -0,0 +1,2 @@ +@prefix eg: <http://example.org/> . +[] eg:p1 1 ; eg:p2 2 . diff --git a/test/extra/longhand/collection_object.ttl b/test/extra/longhand/collection_object.ttl new file mode 100644 index 00000000..3310c418 --- /dev/null +++ b/test/extra/longhand/collection_object.ttl @@ -0,0 +1,2 @@ +@prefix eg: <http://example.org/> . +eg:s eg:p1 ( 1 2 ) ; eg:p2 ( 3 4 ) . diff --git a/test/extra/longhand/collection_subject.ttl b/test/extra/longhand/collection_subject.ttl new file mode 100644 index 00000000..43670620 --- /dev/null +++ b/test/extra/longhand/collection_subject.ttl @@ -0,0 +1,2 @@ +@prefix eg: <http://example.org/> . +( 1 2 ) eg:p3 3 ; eg:p4 4 . diff --git a/test/extra/longhand/longhand.ttl b/test/extra/longhand/longhand.ttl new file mode 100644 index 00000000..b756ce91 --- /dev/null +++ b/test/extra/longhand/longhand.ttl @@ -0,0 +1,13 @@ +@prefix eg: <http://example.org/eg#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . + +[] + rdf:type eg:Node ; + eg:with [ + rdf:type eg:NodeChild ; + eg:having ( + [ + rdf:type eg:ListItem + ] + ) + ] . diff --git a/test/extra/longhand/manifest.ttl b/test/extra/longhand/manifest.ttl new file mode 100644 index 00000000..313ca846 --- /dev/null +++ b/test/extra/longhand/manifest.ttl @@ -0,0 +1,16 @@ +@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix rdft: <http://www.w3.org/ns/rdftest#> . + +<> + a mf:Manifest ; + rdfs:comment "Serd longhand writing test suite" ; + mf:entries ( + <#write-longhand> + ) . + +<#write-longhand> + a rdft:TestTurtleEval ; + mf:action <shorthand.ttl> ; + mf:name "write-longhand" ; + mf:result <longhand.ttl> . diff --git a/test/extra/longhand/shorthand.ttl b/test/extra/longhand/shorthand.ttl new file mode 100644 index 00000000..d563021e --- /dev/null +++ b/test/extra/longhand/shorthand.ttl @@ -0,0 +1,13 @@ +@prefix eg: <http://example.org/eg#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . + +[] + a eg:Node ; + eg:with [ + a eg:NodeChild ; + eg:having ( + [ + a eg:ListItem + ] + ) + ] . diff --git a/test/meson.build b/test/meson.build index 43fc7211..c186b6e4 100644 --- a/test/meson.build +++ b/test/meson.build @@ -507,6 +507,17 @@ test_suites = { files('extra/lax/manifest.ttl'), ns_serdtest + 'lax/', ], + 'longhand_forward': [ + files('extra/longhand/manifest.ttl'), + ns_serdtest + 'longhand/', + '--', + ['-O', 'longhand'], + ], + 'longhand_reverse': [ + '--reverse', + files('extra/longhand/manifest.ttl'), + ns_serdtest + 'longhand/', + ], 'pattern': [ files('extra/pattern/manifest.ttl'), ns_serdtest + 'pattern/', |