aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/bad/bad-var.ttl2
-rw-r--r--test/bad/manifest.ttl6
-rw-r--r--test/meson.build7
-rw-r--r--test/pattern/bad-pattern.nq1
-rw-r--r--test/pattern/bad-pattern.ttl2
-rw-r--r--test/pattern/manifest.ttl35
-rw-r--r--test/pattern/test-pattern.nt6
-rw-r--r--test/pattern/test-pattern.ttl10
-rw-r--r--test/test_overflow.c4
9 files changed, 72 insertions, 1 deletions
diff --git a/test/bad/bad-var.ttl b/test/bad/bad-var.ttl
new file mode 100644
index 00000000..29b5b008
--- /dev/null
+++ b/test/bad/bad-var.ttl
@@ -0,0 +1,2 @@
+?s
+ <http://example.org/p> <http://example.org/o> .
diff --git a/test/bad/manifest.ttl b/test/bad/manifest.ttl
index 5f208983..f76a9d1b 100644
--- a/test/bad/manifest.ttl
+++ b/test/bad/manifest.ttl
@@ -71,6 +71,7 @@
<#bad-string>
<#bad-subject>
<#bad-uri-escape>
+ <#bad-var>
<#bad-verb>
<#invalid-char-in-local>
<#invalid-char-in-prefix>
@@ -400,6 +401,11 @@
mf:name "bad-uri-escape" ;
mf:action <bad-uri-escape.ttl> .
+<#bad-var>
+ rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "bad-var" ;
+ mf:action <bad-var.ttl> .
+
<#bad-verb>
rdf:type rdft:TestTurtleNegativeSyntax ;
mf:name "bad-verb" ;
diff --git a/test/meson.build b/test/meson.build
index ac1fb205..3d12d211 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -159,6 +159,13 @@ if get_option('utils')
suite: ['rdf', 'serd'],
timeout: 240)
+ manifest = files('pattern' / 'manifest.ttl')
+ base_uri = serd_base + 'pattern' + '/'
+ test('pattern', run_test_suite,
+ args: script_args + [manifest, base_uri, '--', '-x'],
+ suite: ['rdf', 'serd'],
+ timeout: 240)
+
### Run the lax suite with lax parsing enabled as well
manifest = files('lax/manifest.ttl')
base_uri = serd_base + 'lax/'
diff --git a/test/pattern/bad-pattern.nq b/test/pattern/bad-pattern.nq
new file mode 100644
index 00000000..a7e0c994
--- /dev/null
+++ b/test/pattern/bad-pattern.nq
@@ -0,0 +1 @@
+<http://example.org/s> ?pµ <http://example.org/o> .
diff --git a/test/pattern/bad-pattern.ttl b/test/pattern/bad-pattern.ttl
new file mode 100644
index 00000000..5f3dbfdd
--- /dev/null
+++ b/test/pattern/bad-pattern.ttl
@@ -0,0 +1,2 @@
+?sµ
+ <http://example.org/p> <http://example.org/o> .
diff --git a/test/pattern/manifest.ttl b/test/pattern/manifest.ttl
new file mode 100644
index 00000000..a179a64d
--- /dev/null
+++ b/test/pattern/manifest.ttl
@@ -0,0 +1,35 @@
+@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix rdft: <http://www.w3.org/ns/rdftest#> .
+
+<>
+ rdf:type mf:Manifest ;
+ rdfs:comment "Serd pattern syntax test cases" ;
+ mf:entries (
+ <#bad-pattern-nq>
+ <#bad-pattern-ttl>
+ <#test-pattern-nt>
+ <#test-pattern-ttl>
+ ) .
+
+<#bad-pattern-nq>
+ rdf:type rdft:TestNQuadsNegativeSyntax ;
+ mf:name "bad-pattern-nq" ;
+ mf:action <bad-pattern.nq> .
+
+<#bad-pattern-ttl>
+ rdf:type rdft:TestTurtleNegativeSyntax ;
+ mf:name "bad-pattern" ;
+ mf:action <bad-pattern.ttl> .
+
+<#test-pattern-nt>
+ rdf:type rdft:TestNTriplesPositiveSyntax ;
+ mf:name "test-pattern-nt" ;
+ mf:action <test-pattern.nt> .
+
+<#test-pattern-ttl>
+ rdf:type rdft:TestTurtleEval ;
+ mf:name "test-pattern" ;
+ mf:action <test-pattern.ttl> ;
+ mf:result <test-pattern.nt> .
diff --git a/test/pattern/test-pattern.nt b/test/pattern/test-pattern.nt
new file mode 100644
index 00000000..ddfe6d3c
--- /dev/null
+++ b/test/pattern/test-pattern.nt
@@ -0,0 +1,6 @@
+?s <http://example.org/p1> <http://example.org/o1> .
+<http://example.org/s> ?p <http://example.org/o1> .
+<http://example.org/s> <http://example.org/p1> ?o .
+<http://example.org/s> <http://example.org/p2> _:b1 .
+_:b1 ?2p <http://example.org/o2> .
+_:b1 <http://example.org/p3> ?_o .
diff --git a/test/pattern/test-pattern.ttl b/test/pattern/test-pattern.ttl
new file mode 100644
index 00000000..3742e5ed
--- /dev/null
+++ b/test/pattern/test-pattern.ttl
@@ -0,0 +1,10 @@
+?s
+ <http://example.org/p1> <http://example.org/o1> .
+
+<http://example.org/s>
+ ?p <http://example.org/o1> ;
+ <http://example.org/p1> ?o ;
+ <http://example.org/p2> [
+ ?2p <http://example.org/o2> ;
+ <http://example.org/p3> ?_o
+ ] .
diff --git a/test/test_overflow.c b/test/test_overflow.c
index 5a65d887..851c8289 100644
--- a/test/test_overflow.c
+++ b/test/test_overflow.c
@@ -26,7 +26,8 @@ test(SerdWorld* world, SerdSink* sink, const char* str, size_t stack_size)
{
SerdByteSource* byte_source = serd_byte_source_new_string(str, NULL);
- SerdReader* reader = serd_reader_new(world, SERD_TURTLE, 0, sink, stack_size);
+ SerdReader* reader =
+ serd_reader_new(world, SERD_TURTLE, SERD_READ_VARIABLES, sink, stack_size);
serd_reader_start(reader, byte_source);
const SerdStatus st = serd_reader_read_document(reader);
@@ -55,6 +56,7 @@ main(void)
{":s :p \"literal\"", sizes + 264},
{":s :p \"verb\"", sizes + 263},
{":s :p _:blank .", sizes + 276},
+ {":s :p ?o .", sizes + 295},
{":s :p true .", sizes + 295},
{":s :p true .", sizes + 329},
{":s :p \"\"@en .", sizes + 302},