aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-05-15 08:42:40 -0400
committerDavid Robillard <d@drobilla.net>2022-01-14 19:37:51 -0500
commit8974148437e9c98bc715a96a0cdeef8f7a9726f2 (patch)
treec70fadd8014f65cd7a31a8a9a98ea8424f7fba8d
parentdaf4a7574d1977567c3da3d7fa561710139eb052 (diff)
downloadserd-8974148437e9c98bc715a96a0cdeef8f7a9726f2.tar.gz
serd-8974148437e9c98bc715a96a0cdeef8f7a9726f2.tar.bz2
serd-8974148437e9c98bc715a96a0cdeef8f7a9726f2.zip
Add tests for weird prefixed name edge cases in RDF 1.1 Turtle
-rw-r--r--test/bad/bad-prefix-dot.ttl1
-rw-r--r--test/bad/manifest.ttl6
-rw-r--r--test/good/manifest.ttl14
-rw-r--r--test/good/test-local-name-ends-with-dot.nt1
-rw-r--r--test/good/test-local-name-escapes.nt17
-rw-r--r--test/good/test-local-name-escapes.ttl19
6 files changed, 58 insertions, 0 deletions
diff --git a/test/bad/bad-prefix-dot.ttl b/test/bad/bad-prefix-dot.ttl
new file mode 100644
index 00000000..7b02211f
--- /dev/null
+++ b/test/bad/bad-prefix-dot.ttl
@@ -0,0 +1 @@
+@prefix dotted.: <http://example.org/> .
diff --git a/test/bad/manifest.ttl b/test/bad/manifest.ttl
index 28841e82..00f7e360 100644
--- a/test/bad/manifest.ttl
+++ b/test/bad/manifest.ttl
@@ -66,6 +66,7 @@
<#bad-object2>
<#bad-object>
<#bad-pn-escape>
+ <#bad-prefix-dot>
<#bad-prefix>
<#bad-quote-in-uri>
<#bad-semicolon-after-subject>
@@ -378,6 +379,11 @@
mf:name "bad-pn-escape" ;
mf:action <bad-pn-escape.ttl> .
+<#bad-prefix-dot>
+ rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "bad-prefix-dot" ;
+ mf:action <bad-prefix-dot.ttl> .
+
<#bad-prefix>
rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "bad-prefix" ;
diff --git a/test/good/manifest.ttl b/test/good/manifest.ttl
index fe3e195e..b546b9f7 100644
--- a/test/good/manifest.ttl
+++ b/test/good/manifest.ttl
@@ -38,6 +38,8 @@
<#test-list-in-blank>
<#test-list-subject>
<#test-list>
+ <#test-local-name-ends-with-dot>
+ <#test-local-name-escapes>
<#test-long-string>
<#test-several-eaten-dots>
<#test-no-spaces>
@@ -226,6 +228,18 @@
mf:action <test-list.ttl> ;
mf:result <test-list.nt> .
+<#test-local-name-ends-with-dot>
+ rdf:type rdft:TestTurtleEval ;
+ mf:name "test-local-name-ends-with-dot" ;
+ mf:action <test-local-name-ends-with-dot.ttl> ;
+ mf:result <test-local-name-ends-with-dot.nt> .
+
+<#test-local-name-escapes>
+ rdf:type rdft:TestTurtleEval ;
+ mf:name "test-local-name-escapes" ;
+ mf:action <test-local-name-escapes.ttl> ;
+ mf:result <test-local-name-escapes.nt> .
+
<#test-long-string>
rdf:type rdft:TestTurtleEval ;
mf:name "test-long-string" ;
diff --git a/test/good/test-local-name-ends-with-dot.nt b/test/good/test-local-name-ends-with-dot.nt
new file mode 100644
index 00000000..260eaffe
--- /dev/null
+++ b/test/good/test-local-name-ends-with-dot.nt
@@ -0,0 +1 @@
+<http://example.org/s> <http://example.org/p> <http://example.org/foo.> .
diff --git a/test/good/test-local-name-escapes.nt b/test/good/test-local-name-escapes.nt
new file mode 100644
index 00000000..a6362d7a
--- /dev/null
+++ b/test/good/test-local-name-escapes.nt
@@ -0,0 +1,17 @@
+<http://example.org/s> <http://example.org/p> <http://example.org/o'> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o!> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o#> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o$> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o%> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o&> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o(> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o)> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o*> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o+> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o,> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o/> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o;> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o=> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o?> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o@> .
+<http://example.org/s> <http://example.org/p> <http://example.org/o~> .
diff --git a/test/good/test-local-name-escapes.ttl b/test/good/test-local-name-escapes.ttl
new file mode 100644
index 00000000..8c5fce37
--- /dev/null
+++ b/test/good/test-local-name-escapes.ttl
@@ -0,0 +1,19 @@
+@prefix eg: <http://example.org/> .
+
+eg:s eg:p eg:o\' .
+eg:s eg:p eg:o\! .
+eg:s eg:p eg:o\# .
+eg:s eg:p eg:o\$ .
+eg:s eg:p eg:o\% .
+eg:s eg:p eg:o\& .
+eg:s eg:p eg:o\( .
+eg:s eg:p eg:o\) .
+eg:s eg:p eg:o\* .
+eg:s eg:p eg:o\+ .
+eg:s eg:p eg:o\, .
+eg:s eg:p eg:o\/ .
+eg:s eg:p eg:o\; .
+eg:s eg:p eg:o\= .
+eg:s eg:p eg:o\? .
+eg:s eg:p eg:o\@ .
+eg:s eg:p eg:o\~ .