From bbe5313c31386366175222cde3055b63848ebb4c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 25 Nov 2018 16:12:23 +0100 Subject: Fix lax handling of string errors and add separate lax test suite --- tests/good/manifest.ttl | 7 ------- tests/good/test-bad-utf8.nt | 3 --- tests/good/test-bad-utf8.ttl | 3 --- tests/lax/manifest.ttl | 25 +++++++++++++++++++++++++ tests/lax/test-bad-uri.nt | 3 +++ tests/lax/test-bad-uri.ttl | 4 ++++ tests/lax/test-bad-utf8.nt | 6 ++++++ tests/lax/test-bad-utf8.ttl | 6 ++++++ 8 files changed, 44 insertions(+), 13 deletions(-) delete mode 100644 tests/good/test-bad-utf8.nt delete mode 100644 tests/good/test-bad-utf8.ttl create mode 100644 tests/lax/manifest.ttl create mode 100644 tests/lax/test-bad-uri.nt create mode 100644 tests/lax/test-bad-uri.ttl create mode 100644 tests/lax/test-bad-utf8.nt create mode 100644 tests/lax/test-bad-utf8.ttl (limited to 'tests') diff --git a/tests/good/manifest.ttl b/tests/good/manifest.ttl index dd83a7e5..9dccde7b 100644 --- a/tests/good/manifest.ttl +++ b/tests/good/manifest.ttl @@ -18,7 +18,6 @@ <#test-30> <#test-a-without-whitespace> <#test-backspace> - <#test-bad-utf8> <#test-base-query> <#test-blank-cont> <#test-blank-in-list> @@ -109,12 +108,6 @@ mf:action ; mf:result . -<#test-bad-utf8> - rdf:type rdft:TestTurtleEval ; - mf:name "test-bad-utf8" ; - mf:action ; - mf:result . - <#test-base-query> rdf:type rdft:TestTurtleEval ; mf:name "test-base-query" ; diff --git a/tests/good/test-bad-utf8.nt b/tests/good/test-bad-utf8.nt deleted file mode 100644 index 6d73993d..00000000 --- a/tests/good/test-bad-utf8.nt +++ /dev/null @@ -1,3 +0,0 @@ - "Impossible bytes: \uFFFD \uFFFD" . - "2 continuation bytes: \uFFFD" . - "Missing continuation: \uFFFD" . diff --git a/tests/good/test-bad-utf8.ttl b/tests/good/test-bad-utf8.ttl deleted file mode 100644 index 2c105f5b..00000000 --- a/tests/good/test-bad-utf8.ttl +++ /dev/null @@ -1,3 +0,0 @@ - "Impossible bytes: þ ÿ" . - "2 continuation bytes: €¿" . - "Missing continuation: À" . diff --git a/tests/lax/manifest.ttl b/tests/lax/manifest.ttl new file mode 100644 index 00000000..e3b11ff4 --- /dev/null +++ b/tests/lax/manifest.ttl @@ -0,0 +1,25 @@ +@prefix mf: . +@prefix rdf: . +@prefix rdfs: . +@prefix rdft: . + +<> + rdf:type mf:Manifest ; + rdfs:comment "Serd lax syntax test cases" ; + mf:entries ( + <#test-bad-uri> + <#test-bad-utf8> + ) . + +<#test-bad-uri> + rdf:type rdft:TestTurtleNegativeSyntax ; + mf:name "test-bad-uri" ; + mf:action ; + mf:result . + +<#test-bad-utf8> + rdf:type rdft:TestTurtleNegativeSyntax ; + mf:name "test-bad-utf8" ; + mf:action ; + mf:result . + diff --git a/tests/lax/test-bad-uri.nt b/tests/lax/test-bad-uri.nt new file mode 100644 index 00000000..7458e12a --- /dev/null +++ b/tests/lax/test-bad-uri.nt @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/lax/test-bad-uri.ttl b/tests/lax/test-bad-uri.ttl new file mode 100644 index 00000000..8f11b1d7 --- /dev/null +++ b/tests/lax/test-bad-uri.ttl @@ -0,0 +1,4 @@ + . + . + . + . diff --git a/tests/lax/test-bad-utf8.nt b/tests/lax/test-bad-utf8.nt new file mode 100644 index 00000000..09200e9d --- /dev/null +++ b/tests/lax/test-bad-utf8.nt @@ -0,0 +1,6 @@ + "Impossible bytes: \uFFFD \uFFFD" . + "2 continuation bytes: \uFFFD" . + "Missing continuation: \uFFFD" . + "Impossible bytes: \uFFFD \uFFFD" . + "2 continuation bytes: \uFFFD" . + "Missing continuation: \uFFFD" . diff --git a/tests/lax/test-bad-utf8.ttl b/tests/lax/test-bad-utf8.ttl new file mode 100644 index 00000000..526a171f --- /dev/null +++ b/tests/lax/test-bad-utf8.ttl @@ -0,0 +1,6 @@ + "Impossible bytes: þ ÿ" . + "2 continuation bytes: €¿" . + "Missing continuation: À" . + """Impossible bytes: þ ÿ""" . + """2 continuation bytes: €¿""" . + """Missing continuation: À""" . -- cgit v1.2.1