aboutsummaryrefslogtreecommitdiffstats
path: root/test/pretty
diff options
context:
space:
mode:
Diffstat (limited to 'test/pretty')
-rw-r--r--test/pretty/anonymous-in-list-object.ttl11
-rw-r--r--test/pretty/anonymous-object.ttl10
-rw-r--r--test/pretty/anonymous-subject-and-object.ttl4
-rw-r--r--test/pretty/anonymous-subject.ttl4
-rw-r--r--test/pretty/empty-anonymous-object.ttl4
-rw-r--r--test/pretty/empty-list-object.ttl4
-rw-r--r--test/pretty/empty-list-subject-and-object.ttl4
-rw-r--r--test/pretty/empty-list-subject.ttl4
-rw-r--r--test/pretty/list-in-object.ttl10
-rw-r--r--test/pretty/list-object.ttl8
-rw-r--r--test/pretty/list-subject-with-extras.ttl9
-rw-r--r--test/pretty/list-subject-with-list-extras.ttl12
-rw-r--r--test/pretty/list-subject.ttl8
-rw-r--r--test/pretty/manifest.ttl121
-rw-r--r--test/pretty/many-objects.ttl9
-rw-r--r--test/pretty/meson.build17
-rw-r--r--test/pretty/nested-list-object-with-empty-lists.ttl11
-rw-r--r--test/pretty/nested-list-object.ttl13
-rw-r--r--test/pretty/nested-list-subject.ttl13
19 files changed, 276 insertions, 0 deletions
diff --git a/test/pretty/anonymous-in-list-object.ttl b/test/pretty/anonymous-in-list-object.ttl
new file mode 100644
index 00000000..a6b202f4
--- /dev/null
+++ b/test/pretty/anonymous-in-list-object.ttl
@@ -0,0 +1,11 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:p (
+ [
+ a eg:Spy
+ ]
+ [
+ a eg:Ninja
+ ]
+ ) .
diff --git a/test/pretty/anonymous-object.ttl b/test/pretty/anonymous-object.ttl
new file mode 100644
index 00000000..f592fed1
--- /dev/null
+++ b/test/pretty/anonymous-object.ttl
@@ -0,0 +1,10 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:p1 [
+ eg:p2 eg:o2 ;
+ eg:p3 eg:o3
+ ] , [
+ eg:p4 eg:o4 ;
+ eg:p5 eg:o5
+ ] .
diff --git a/test/pretty/anonymous-subject-and-object.ttl b/test/pretty/anonymous-subject-and-object.ttl
new file mode 100644
index 00000000..8904cca6
--- /dev/null
+++ b/test/pretty/anonymous-subject-and-object.ttl
@@ -0,0 +1,4 @@
+@prefix eg: <http://example.org/> .
+
+[]
+ eg:p [] .
diff --git a/test/pretty/anonymous-subject.ttl b/test/pretty/anonymous-subject.ttl
new file mode 100644
index 00000000..e0e467e2
--- /dev/null
+++ b/test/pretty/anonymous-subject.ttl
@@ -0,0 +1,4 @@
+@prefix eg: <http://example.org/> .
+
+[]
+ eg:p eg:o .
diff --git a/test/pretty/empty-anonymous-object.ttl b/test/pretty/empty-anonymous-object.ttl
new file mode 100644
index 00000000..f3b8d7f7
--- /dev/null
+++ b/test/pretty/empty-anonymous-object.ttl
@@ -0,0 +1,4 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:p [] .
diff --git a/test/pretty/empty-list-object.ttl b/test/pretty/empty-list-object.ttl
new file mode 100644
index 00000000..b4045ec0
--- /dev/null
+++ b/test/pretty/empty-list-object.ttl
@@ -0,0 +1,4 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:list () .
diff --git a/test/pretty/empty-list-subject-and-object.ttl b/test/pretty/empty-list-subject-and-object.ttl
new file mode 100644
index 00000000..3b84980e
--- /dev/null
+++ b/test/pretty/empty-list-subject-and-object.ttl
@@ -0,0 +1,4 @@
+@prefix eg: <http://example.org/> .
+
+()
+ eg:list () .
diff --git a/test/pretty/empty-list-subject.ttl b/test/pretty/empty-list-subject.ttl
new file mode 100644
index 00000000..0610eb07
--- /dev/null
+++ b/test/pretty/empty-list-subject.ttl
@@ -0,0 +1,4 @@
+@prefix eg: <http://example.org/> .
+
+()
+ a eg:ExampleList .
diff --git a/test/pretty/list-in-object.ttl b/test/pretty/list-in-object.ttl
new file mode 100644
index 00000000..ce887157
--- /dev/null
+++ b/test/pretty/list-in-object.ttl
@@ -0,0 +1,10 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:p [
+ eg:list (
+ "apple"
+ "banana"
+ "cherry"
+ )
+ ] .
diff --git a/test/pretty/list-object.ttl b/test/pretty/list-object.ttl
new file mode 100644
index 00000000..735d9df6
--- /dev/null
+++ b/test/pretty/list-object.ttl
@@ -0,0 +1,8 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:list (
+ "apple"
+ "banana"
+ "cherry"
+ ) .
diff --git a/test/pretty/list-subject-with-extras.ttl b/test/pretty/list-subject-with-extras.ttl
new file mode 100644
index 00000000..dcfb8753
--- /dev/null
+++ b/test/pretty/list-subject-with-extras.ttl
@@ -0,0 +1,9 @@
+@prefix eg: <http://example.org/> .
+
+(
+ "apple"
+ "banana"
+ "cherry"
+)
+ eg:with eg:someProperties ;
+ a eg:ExampleList .
diff --git a/test/pretty/list-subject-with-list-extras.ttl b/test/pretty/list-subject-with-list-extras.ttl
new file mode 100644
index 00000000..0a0cd0e0
--- /dev/null
+++ b/test/pretty/list-subject-with-list-extras.ttl
@@ -0,0 +1,12 @@
+@prefix eg: <http://example.org/> .
+
+(
+ "apple"
+ "banana"
+ "cherry"
+)
+ eg:list (
+ "asparagus"
+ "beet"
+ "carrot"
+ ) .
diff --git a/test/pretty/list-subject.ttl b/test/pretty/list-subject.ttl
new file mode 100644
index 00000000..eb1c7a2e
--- /dev/null
+++ b/test/pretty/list-subject.ttl
@@ -0,0 +1,8 @@
+@prefix eg: <http://example.org/> .
+
+(
+ "apple"
+ "banana"
+ "cherry"
+)
+ a eg:ExampleList .
diff --git a/test/pretty/manifest.ttl b/test/pretty/manifest.ttl
new file mode 100644
index 00000000..faae5857
--- /dev/null
+++ b/test/pretty/manifest.ttl
@@ -0,0 +1,121 @@
+@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#> .
+@prefix serd: <http://drobilla.net/ns/serd#> .
+
+<>
+ a mf:Manifest ;
+ rdfs:comment "Serd pretty-printing test cases" ;
+ mf:entries (
+ <#anonymous-in-list-object>
+ <#anonymous-object>
+ <#anonymous-subject-and-object>
+ <#anonymous-subject>
+ <#empty-anonymous-object>
+ <#empty-list-object>
+ <#empty-list-subject-and-object>
+ <#empty-list-subject>
+ <#list-in-object>
+ <#list-object>
+ <#list-subject-with-extras>
+ <#list-subject-with-list-extras>
+ <#list-subject>
+ <#many-objects>
+ <#nested-list-object-with-empty-lists>
+ <#nested-list-object>
+ <#nested-list-subject>
+ ) .
+
+<#anonymous-in-list-object>
+ a serd:TestTurtlePrint ;
+ mf:action <anonymous-in-list-object.ttl> ;
+ mf:name "anonymous-in-list-object" .
+
+<#anonymous-object>
+ a serd:TestTurtlePrint ;
+ mf:action <anonymous-object.ttl> ;
+ mf:name "anonymous-object" .
+
+<#anonymous-subject>
+ a serd:TestTurtlePrint ;
+ mf:action <anonymous-subject.ttl> ;
+ mf:name "anonymous-subject" .
+
+<#anonymous-subject-and-object>
+ a serd:TestTurtlePrint ;
+ mf:action <anonymous-subject-and-object.ttl> ;
+ mf:name "anonymous-subject-and-object" .
+
+<#empty-anonymous-object>
+ a serd:TestTurtlePrint ;
+ mf:action <empty-anonymous-object.ttl> ;
+ mf:name "empty-anonymous-object" .
+
+<#empty-list-object>
+ a serd:TestTurtlePrint ;
+ mf:action <empty-list-object.ttl> ;
+ mf:name "empty-list-object" .
+
+<#empty-list-subject>
+ a serd:TestTurtlePrint ;
+ mf:action <empty-list-subject.ttl> ;
+ mf:name "empty-list-subject" .
+
+<#empty-list-subject-and-object>
+ a serd:TestTurtlePrint ;
+ mf:action <empty-list-subject-and-object.ttl> ;
+ mf:name "empty-list-subject-and-object" .
+
+<#list-in-object>
+ a serd:TestTurtlePrint ;
+ mf:action <list-in-object.ttl> ;
+ mf:name "list-in-object" .
+
+<#list-object>
+ a serd:TestTurtlePrint ;
+ mf:action <list-object.ttl> ;
+ mf:name "list-object" .
+
+<#list-subject>
+ a serd:TestTurtlePrint ;
+ mf:action <list-subject.ttl> ;
+ mf:name "list-subject" .
+
+<#list-subject-with-extras>
+ a serd:TestTurtlePrint ;
+ mf:action <list-subject-with-extras.ttl> ;
+ mf:name "list-subject-with-extras" .
+
+<#list-subject-with-list-extras>
+ a serd:TestTurtlePrint ;
+ mf:action <list-subject-with-list-extras.ttl> ;
+ mf:name "list-subject-with-list-extras" .
+
+<#many-objects>
+ a serd:TestTurtlePrint ;
+ mf:action <many-objects.ttl> ;
+ mf:name "many-objects" .
+
+<#nested-list-object>
+ a serd:TestTurtlePrint ;
+ mf:action <nested-list-object.ttl> ;
+ mf:name "nested-list-object" .
+
+<#nested-list-object-with-empty-lists>
+ a serd:TestTurtlePrint ;
+ mf:action <nested-list-object-with-empty-lists.ttl> ;
+ mf:name "nested-list-object-with-empty-lists" .
+
+<#nested-list-subject>
+ a serd:TestTurtlePrint ;
+ mf:action <nested-list-subject.ttl> ;
+ mf:name "nested-list-subject" .
+
+serd:TestTurtlePrint
+ a rdfs:Class ;
+ rdfs:comment "Tests that a Turtle document pretty-prints exactly as written." ;
+ rdfs:label "Turtle Pretty-Printing" ;
+ rdfs:subClassOf rdft:Test .
+
+rdft:Test
+ rdfs:subClassOf mf:ManifestEntry .
diff --git a/test/pretty/many-objects.ttl b/test/pretty/many-objects.ttl
new file mode 100644
index 00000000..534741dd
--- /dev/null
+++ b/test/pretty/many-objects.ttl
@@ -0,0 +1,9 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:p1 "apple" ,
+ "banana" ,
+ "cherry" ;
+ eg:p2 "asparagus" ,
+ "beet" ,
+ "carrot" .
diff --git a/test/pretty/meson.build b/test/pretty/meson.build
new file mode 100644
index 00000000..634f1e0e
--- /dev/null
+++ b/test/pretty/meson.build
@@ -0,0 +1,17 @@
+base_uri = 'http://drobilla.net/sw/serd/test/good/'
+
+args = [files('manifest.ttl')]
+
+test('pretty',
+ run_pretty_suite,
+ args: pipe_test_script_args + ['-o', meson.current_build_dir() / 'pipe'] + args,
+ env: test_env,
+ suite: ['suite', 'extra', 'pipe'],
+ timeout: 240)
+
+test('pretty',
+ run_pretty_suite,
+ args: sort_test_script_args + ['-o', meson.current_build_dir() / 'sort'] + args,
+ env: test_env,
+ suite: ['suite', 'extra', 'sort'],
+ timeout: 240)
diff --git a/test/pretty/nested-list-object-with-empty-lists.ttl b/test/pretty/nested-list-object-with-empty-lists.ttl
new file mode 100644
index 00000000..4760fd2b
--- /dev/null
+++ b/test/pretty/nested-list-object-with-empty-lists.ttl
@@ -0,0 +1,11 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:list (
+ (
+ ()
+ )
+ (
+ ()
+ )
+ ) .
diff --git a/test/pretty/nested-list-object.ttl b/test/pretty/nested-list-object.ttl
new file mode 100644
index 00000000..c4b1898f
--- /dev/null
+++ b/test/pretty/nested-list-object.ttl
@@ -0,0 +1,13 @@
+@prefix eg: <http://example.org/> .
+
+eg:s
+ eg:list (
+ (
+ eg:l1e1
+ eg:l1e2
+ )
+ (
+ eg:l2e1
+ eg:l2e2
+ )
+ ) .
diff --git a/test/pretty/nested-list-subject.ttl b/test/pretty/nested-list-subject.ttl
new file mode 100644
index 00000000..b32aa133
--- /dev/null
+++ b/test/pretty/nested-list-subject.ttl
@@ -0,0 +1,13 @@
+@prefix eg: <http://example.org/> .
+
+(
+ (
+ eg:l1e1
+ eg:l1e2
+ )
+ (
+ eg:l2e1
+ eg:l2e2
+ )
+)
+ a eg:ExampleList .