diff options
author | David Robillard <d@drobilla.net> | 2021-07-13 14:39:11 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-14 19:37:51 -0500 |
commit | 45902fbbaa11e8c38944b38182afb92bc0641ec9 (patch) | |
tree | 982b4a33c8483273a4feb9364ec75107241e0470 /test/lax | |
parent | 840139223c77dba90b5ef92537e6c982b000c196 (diff) | |
download | serd-45902fbbaa11e8c38944b38182afb92bc0641ec9.tar.gz serd-45902fbbaa11e8c38944b38182afb92bc0641ec9.tar.bz2 serd-45902fbbaa11e8c38944b38182afb92bc0641ec9.zip |
Test lax NTriples parsing separately
Diffstat (limited to 'test/lax')
-rw-r--r-- | test/lax/manifest.ttl | 60 | ||||
-rw-r--r-- | test/lax/test-bad-string-out.nq | 1 | ||||
-rw-r--r-- | test/lax/test-bad-string-out.nt | 1 | ||||
-rw-r--r-- | test/lax/test-bad-string.nt | 2 | ||||
-rw-r--r-- | test/lax/test-bad-uri-nq-out.nq | 4 | ||||
-rw-r--r-- | test/lax/test-bad-uri-out.nt | 4 | ||||
-rw-r--r-- | test/lax/test-bad-uri.nq | 4 | ||||
-rw-r--r-- | test/lax/test-bad-uri.nt | 4 | ||||
-rw-r--r-- | test/lax/test-bad-uri.ttl | 9 | ||||
-rw-r--r-- | test/lax/test-bad-utf8-nq-out.nq | 3 | ||||
-rw-r--r-- | test/lax/test-bad-utf8-nt-out.nt | 3 | ||||
-rw-r--r-- | test/lax/test-bad-utf8-ttl-out.nt | 6 | ||||
-rw-r--r-- | test/lax/test-bad-utf8.nq | 3 | ||||
-rw-r--r-- | test/lax/test-bad-utf8.nt | 9 |
14 files changed, 88 insertions, 25 deletions
diff --git a/test/lax/manifest.ttl b/test/lax/manifest.ttl index c3218a6b..b63da6d4 100644 --- a/test/lax/manifest.ttl +++ b/test/lax/manifest.ttl @@ -7,33 +7,67 @@ rdf:type mf:Manifest ; rdfs:comment "Serd lax syntax test cases" ; mf:entries ( - <#test-bad-string> - <#test-bad-uri> - <#test-bad-utf8> + <#test-bad-string-ttl> + <#test-bad-string-nt> + <#test-bad-uri-ttl> + <#test-bad-uri-nt> + <#test-bad-uri-nq> + <#test-bad-utf8-ttl> + <#test-bad-utf8-nt> + <#test-bad-utf8-nq> <#test-lone-list> ) . -<#test-bad-string> +<#test-bad-string-ttl> rdf:type rdft:TestTurtleNegativeSyntax ; - mf:name "test-bad-string" ; + mf:name "test-bad-string-ttl" ; mf:action <test-bad-string.ttl> ; - mf:result <test-bad-string.nt> . + mf:result <test-bad-string-out.nt> . -<#test-bad-uri> +<#test-bad-string-nt> + rdf:type rdft:TestNTriplesNegativeSyntax ; + mf:name "test-bad-string-nt" ; + mf:action <test-bad-string.nt> ; + mf:result <test-bad-string-out.nt> . + +<#test-bad-uri-ttl> rdf:type rdft:TestTurtleNegativeSyntax ; - mf:name "test-bad-uri" ; + mf:name "test-bad-uri-ttl" ; mf:action <test-bad-uri.ttl> ; - mf:result <test-bad-uri.nt> . + mf:result <test-bad-uri-out.nt> . + +<#test-bad-uri-nt> + rdf:type rdft:TestNTriplesNegativeSyntax ; + mf:name "test-bad-uri-nt" ; + mf:action <test-bad-uri.nt> ; + mf:result <test-bad-uri-out.nt> . + +<#test-bad-uri-nq> + rdf:type rdft:TestNQuadsNegativeSynqax ; + mf:name "test-bad-uri-nq" ; + mf:action <test-bad-uri.nq> ; + mf:result <test-bad-uri-nq-out.nq> . -<#test-bad-utf8> +<#test-bad-utf8-ttl> rdf:type rdft:TestTurtleNegativeSyntax ; - mf:name "test-bad-utf8" ; + mf:name "test-bad-utf8-ttl" ; mf:action <test-bad-utf8.ttl> ; - mf:result <test-bad-utf8.nt> . + mf:result <test-bad-utf8-ttl-out.nt> . + +<#test-bad-utf8-nt> + rdf:type rdft:TestNTriplesNegativeSyntax ; + mf:name "test-bad-utf8-nt" ; + mf:action <test-bad-utf8.nt> ; + mf:result <test-bad-utf8-nt-out.nt> . + +<#test-bad-utf8-nq> + rdf:type rdft:TestNQuadsNegativeSynqax ; + mf:name "test-bad-utf8-nq" ; + mf:action <test-bad-utf8.nq> ; + mf:result <test-bad-utf8-nq-out.nq> . <#test-lone-list> rdf:type rdft:TestTurtleNegativeSyntax ; mf:name "test-lone-list" ; mf:action <test-lone-list.ttl> ; mf:result <test-lone-list.nt> . - diff --git a/test/lax/test-bad-string-out.nq b/test/lax/test-bad-string-out.nq new file mode 100644 index 00000000..24f80a2e --- /dev/null +++ b/test/lax/test-bad-string-out.nq @@ -0,0 +1 @@ +<http://example.org/s1> <http://example.org/p2> "Good" . diff --git a/test/lax/test-bad-string-out.nt b/test/lax/test-bad-string-out.nt new file mode 100644 index 00000000..24f80a2e --- /dev/null +++ b/test/lax/test-bad-string-out.nt @@ -0,0 +1 @@ +<http://example.org/s1> <http://example.org/p2> "Good" . diff --git a/test/lax/test-bad-string.nt b/test/lax/test-bad-string.nt index 24f80a2e..72eb9621 100644 --- a/test/lax/test-bad-string.nt +++ b/test/lax/test-bad-string.nt @@ -1 +1,3 @@ +<http://example.org/s1> <http://example.org/p1> "Truncated line +<http://example.org/s1> <http://example.org/p1> "Bad escape \? " . <http://example.org/s1> <http://example.org/p2> "Good" . diff --git a/test/lax/test-bad-uri-nq-out.nq b/test/lax/test-bad-uri-nq-out.nq new file mode 100644 index 00000000..8cb00ba7 --- /dev/null +++ b/test/lax/test-bad-uri-nq-out.nq @@ -0,0 +1,4 @@ +<http://example.org/s> <http://example.org/p> <http://example.org/\u0009bado1> . +<http://example.org/s> <http://example.org/p> <http://example.org/goodo1> . +<http://example.org/s> <http://example.org/p> <http://example.org/\uFFFDbado2> . +<http://example.org/s> <http://example.org/p> <http://example.org/goodo2> . diff --git a/test/lax/test-bad-uri-out.nt b/test/lax/test-bad-uri-out.nt new file mode 100644 index 00000000..8cb00ba7 --- /dev/null +++ b/test/lax/test-bad-uri-out.nt @@ -0,0 +1,4 @@ +<http://example.org/s> <http://example.org/p> <http://example.org/\u0009bado1> . +<http://example.org/s> <http://example.org/p> <http://example.org/goodo1> . +<http://example.org/s> <http://example.org/p> <http://example.org/\uFFFDbado2> . +<http://example.org/s> <http://example.org/p> <http://example.org/goodo2> . diff --git a/test/lax/test-bad-uri.nq b/test/lax/test-bad-uri.nq new file mode 100644 index 00000000..8f11b1d7 --- /dev/null +++ b/test/lax/test-bad-uri.nq @@ -0,0 +1,4 @@ +<http://example.org/s> <http://example.org/p> <http://example.org/ bado1> . +<http://example.org/s> <http://example.org/p> <http://example.org/goodo1> . +<http://example.org/s> <http://example.org/p> <http://example.org/ÿÿbado2> . +<http://example.org/s> <http://example.org/p> <http://example.org/goodo2> . diff --git a/test/lax/test-bad-uri.nt b/test/lax/test-bad-uri.nt index 8cb00ba7..8f11b1d7 100644 --- a/test/lax/test-bad-uri.nt +++ b/test/lax/test-bad-uri.nt @@ -1,4 +1,4 @@ -<http://example.org/s> <http://example.org/p> <http://example.org/\u0009bado1> . +<http://example.org/s> <http://example.org/p> <http://example.org/ bado1> . <http://example.org/s> <http://example.org/p> <http://example.org/goodo1> . -<http://example.org/s> <http://example.org/p> <http://example.org/\uFFFDbado2> . +<http://example.org/s> <http://example.org/p> <http://example.org/ÿÿbado2> . <http://example.org/s> <http://example.org/p> <http://example.org/goodo2> . diff --git a/test/lax/test-bad-uri.ttl b/test/lax/test-bad-uri.ttl index 8f11b1d7..1a724fd1 100644 --- a/test/lax/test-bad-uri.ttl +++ b/test/lax/test-bad-uri.ttl @@ -1,4 +1,5 @@ -<http://example.org/s> <http://example.org/p> <http://example.org/ bado1> . -<http://example.org/s> <http://example.org/p> <http://example.org/goodo1> . -<http://example.org/s> <http://example.org/p> <http://example.org/ÿÿbado2> . -<http://example.org/s> <http://example.org/p> <http://example.org/goodo2> . +<http://example.org/s> + <http://example.org/p> <http://example.org/ bado1> , + <http://example.org/goodo1> ; + <http://example.org/p> <http://example.org/ÿÿbado2> ; + <http://example.org/p> <http://example.org/goodo2> . diff --git a/test/lax/test-bad-utf8-nq-out.nq b/test/lax/test-bad-utf8-nq-out.nq new file mode 100644 index 00000000..6d73993d --- /dev/null +++ b/test/lax/test-bad-utf8-nq-out.nq @@ -0,0 +1,3 @@ +<http://example.org/thing> <http://example.org/comment> "Impossible bytes: \uFFFD \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "2 continuation bytes: \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "Missing continuation: \uFFFD" . diff --git a/test/lax/test-bad-utf8-nt-out.nt b/test/lax/test-bad-utf8-nt-out.nt new file mode 100644 index 00000000..6d73993d --- /dev/null +++ b/test/lax/test-bad-utf8-nt-out.nt @@ -0,0 +1,3 @@ +<http://example.org/thing> <http://example.org/comment> "Impossible bytes: \uFFFD \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "2 continuation bytes: \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "Missing continuation: \uFFFD" . diff --git a/test/lax/test-bad-utf8-ttl-out.nt b/test/lax/test-bad-utf8-ttl-out.nt new file mode 100644 index 00000000..09200e9d --- /dev/null +++ b/test/lax/test-bad-utf8-ttl-out.nt @@ -0,0 +1,6 @@ +<http://example.org/thing> <http://example.org/comment> "Impossible bytes: \uFFFD \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "2 continuation bytes: \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "Missing continuation: \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "Impossible bytes: \uFFFD \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "2 continuation bytes: \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "Missing continuation: \uFFFD" . diff --git a/test/lax/test-bad-utf8.nq b/test/lax/test-bad-utf8.nq new file mode 100644 index 00000000..2c105f5b --- /dev/null +++ b/test/lax/test-bad-utf8.nq @@ -0,0 +1,3 @@ +<http://example.org/thing> <http://example.org/comment> "Impossible bytes: þ ÿ" . +<http://example.org/thing> <http://example.org/comment> "2 continuation bytes: €¿" . +<http://example.org/thing> <http://example.org/comment> "Missing continuation: À" . diff --git a/test/lax/test-bad-utf8.nt b/test/lax/test-bad-utf8.nt index 09200e9d..2c105f5b 100644 --- a/test/lax/test-bad-utf8.nt +++ b/test/lax/test-bad-utf8.nt @@ -1,6 +1,3 @@ -<http://example.org/thing> <http://example.org/comment> "Impossible bytes: \uFFFD \uFFFD" . -<http://example.org/thing> <http://example.org/comment> "2 continuation bytes: \uFFFD" . -<http://example.org/thing> <http://example.org/comment> "Missing continuation: \uFFFD" . -<http://example.org/thing> <http://example.org/comment> "Impossible bytes: \uFFFD \uFFFD" . -<http://example.org/thing> <http://example.org/comment> "2 continuation bytes: \uFFFD" . -<http://example.org/thing> <http://example.org/comment> "Missing continuation: \uFFFD" . +<http://example.org/thing> <http://example.org/comment> "Impossible bytes: þ ÿ" . +<http://example.org/thing> <http://example.org/comment> "2 continuation bytes: €¿" . +<http://example.org/thing> <http://example.org/comment> "Missing continuation: À" . |