aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bad-base.ttl1
-rw-r--r--tests/bad-datatype.ttl1
-rw-r--r--tests/bad-eof-in-lang-suffix.ttl3
-rw-r--r--tests/bad-eof-in-lang.ttl3
-rw-r--r--tests/bad-eof-in-object-list.ttl2
-rw-r--r--tests/bad-eof-in-object-list2.ttl2
-rw-r--r--tests/bad-eof-in-predicate-list.ttl2
-rw-r--r--tests/bad-hex-digit.ttl1
-rw-r--r--tests/bad-list.ttl2
-rw-r--r--tests/bad-list2.ttl3
-rw-r--r--tests/bad-namespace.ttl1
-rw-r--r--tests/bad-object.ttl3
-rw-r--r--tests/bad-object2.ttl3
-rw-r--r--tests/bad-verb.ttl2
-rw-r--r--tests/serd_test.c160
-rw-r--r--tests/test-backspace.out1
-rw-r--r--tests/test-backspace.ttl3
-rw-r--r--tests/test-cr.out1
-rw-r--r--tests/test-cr.ttl2
-rw-r--r--tests/test-delete.out2
-rw-r--r--tests/test-delete.ttl2
-rw-r--r--tests/test-eof-at-page-end.out1
-rw-r--r--tests/test-eof-at-page-end.ttl85
-rw-r--r--tests/test-lang.out1
-rw-r--r--tests/test-lang.ttl3
-rw-r--r--tests/test-list.out1
-rw-r--r--tests/test-list.ttl1
-rw-r--r--tests/test-no-spaces.out4
-rw-r--r--tests/test-no-spaces.ttl3
-rw-r--r--tests/test-num.out1
-rw-r--r--tests/test-num.ttl1
-rw-r--r--tests/test-prefix.out4
-rw-r--r--tests/test-prefix.ttl6
-rw-r--r--tests/test-uri.out1
-rw-r--r--tests/test-uri.ttl1
-rw-r--r--tests/test-utf8-uri.out1
-rw-r--r--tests/test-utf8-uri.ttl1
37 files changed, 291 insertions, 24 deletions
diff --git a/tests/bad-base.ttl b/tests/bad-base.ttl
new file mode 100644
index 00000000..85421999
--- /dev/null
+++ b/tests/bad-base.ttl
@@ -0,0 +1 @@
+@base "I'm quite certain this is not a URI" . \ No newline at end of file
diff --git a/tests/bad-datatype.ttl b/tests/bad-datatype.ttl
new file mode 100644
index 00000000..0dd6018f
--- /dev/null
+++ b/tests/bad-datatype.ttl
@@ -0,0 +1 @@
+<> <http://example.org/pred> "hello"^^"not-a-uri" . \ No newline at end of file
diff --git a/tests/bad-eof-in-lang-suffix.ttl b/tests/bad-eof-in-lang-suffix.ttl
new file mode 100644
index 00000000..8e3002cb
--- /dev/null
+++ b/tests/bad-eof-in-lang-suffix.ttl
@@ -0,0 +1,3 @@
+@prefix eg: <http://example.org> .
+
+<> eg:comment "That ain't no language"@en-x \ No newline at end of file
diff --git a/tests/bad-eof-in-lang.ttl b/tests/bad-eof-in-lang.ttl
new file mode 100644
index 00000000..54db417f
--- /dev/null
+++ b/tests/bad-eof-in-lang.ttl
@@ -0,0 +1,3 @@
+@prefix eg: <http://example.org> .
+
+<> eg:comment "That ain't no language"@a \ No newline at end of file
diff --git a/tests/bad-eof-in-object-list.ttl b/tests/bad-eof-in-object-list.ttl
new file mode 100644
index 00000000..9bbcd17a
--- /dev/null
+++ b/tests/bad-eof-in-object-list.ttl
@@ -0,0 +1,2 @@
+@prefix eg: <http://example.org/> .
+<> eg:p eg:o , \ No newline at end of file
diff --git a/tests/bad-eof-in-object-list2.ttl b/tests/bad-eof-in-object-list2.ttl
new file mode 100644
index 00000000..9186fb9f
--- /dev/null
+++ b/tests/bad-eof-in-object-list2.ttl
@@ -0,0 +1,2 @@
+@prefix eg: <http://example.org/> .
+<> eg:p eg:o ; eg:p1 eg:o2 , \ No newline at end of file
diff --git a/tests/bad-eof-in-predicate-list.ttl b/tests/bad-eof-in-predicate-list.ttl
new file mode 100644
index 00000000..eab5b05b
--- /dev/null
+++ b/tests/bad-eof-in-predicate-list.ttl
@@ -0,0 +1,2 @@
+@prefix eg: <http://example.org/> .
+<> eg:p eg:o ; \ No newline at end of file
diff --git a/tests/bad-hex-digit.ttl b/tests/bad-hex-digit.ttl
new file mode 100644
index 00000000..85816ced
--- /dev/null
+++ b/tests/bad-hex-digit.ttl
@@ -0,0 +1 @@
+<http://example.org/thing> <http://example.org/comment> "\uABCG" .
diff --git a/tests/bad-list.ttl b/tests/bad-list.ttl
index 60e21351..5606658e 100644
--- a/tests/bad-list.ttl
+++ b/tests/bad-list.ttl
@@ -1 +1 @@
-<> <http://example.org/pred> ( \ No newline at end of file
+<> <http://example.org/pred> <http://example.org/valid> , invalid . \ No newline at end of file
diff --git a/tests/bad-list2.ttl b/tests/bad-list2.ttl
new file mode 100644
index 00000000..b5242de2
--- /dev/null
+++ b/tests/bad-list2.ttl
@@ -0,0 +1,3 @@
+@prefix eg: <http://example.org> .
+
+<> eg:thing ( . \ No newline at end of file
diff --git a/tests/bad-namespace.ttl b/tests/bad-namespace.ttl
new file mode 100644
index 00000000..0dd78d33
--- /dev/null
+++ b/tests/bad-namespace.ttl
@@ -0,0 +1 @@
+@prefix eg: "what?" . \ No newline at end of file
diff --git a/tests/bad-object.ttl b/tests/bad-object.ttl
new file mode 100644
index 00000000..9fc6da18
--- /dev/null
+++ b/tests/bad-object.ttl
@@ -0,0 +1,3 @@
+@prefix eg: <http://example.org/> .
+
+eg:thing a four .
diff --git a/tests/bad-object2.ttl b/tests/bad-object2.ttl
new file mode 100644
index 00000000..9293d168
--- /dev/null
+++ b/tests/bad-object2.ttl
@@ -0,0 +1,3 @@
+@prefix eg: <http://example.org/> .
+
+eg:thing a fives .
diff --git a/tests/bad-verb.ttl b/tests/bad-verb.ttl
new file mode 100644
index 00000000..56a134f3
--- /dev/null
+++ b/tests/bad-verb.ttl
@@ -0,0 +1,2 @@
+@prefix a: <http://example.org/> .
+a:thing x a:Thing . \ No newline at end of file
diff --git a/tests/serd_test.c b/tests/serd_test.c
index aca88127..7eb9a67e 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -82,7 +82,7 @@ main()
};
const char* expt_test_strs[] = {
- "02e18", "-5e019", "+8e20", "2E+34", "-5E-5", "8E0", "9e-0", "2e+0"
+ "02e18", "-5e019", "+8e20", "2E+34", "-5E-5", "8E0", "9e-0", " 2e+0"
};
for (unsigned i = 0; i < sizeof(expt_test_nums) / sizeof(double); ++i) {
@@ -99,11 +99,11 @@ main()
// Test serd_node_new_decimal
const double dbl_test_nums[] = {
- 0.0, 42.0, .01, 8.0, 2.05, -16.00001, 5.000000005
+ 0.0, 42.0, .01, 2.05, -16.00001, 5.000000005, 0.0000000001
};
const char* dbl_test_strs[] = {
- "0.0", "42.0", "0.01", "8.0", "2.05", "-16.00001", "5.00000001"
+ "0.0", "42.0", "0.01", "2.05", "-16.00001", "5.00000001", "0.0"
};
for (unsigned i = 0; i < sizeof(dbl_test_nums) / sizeof(double); ++i) {
@@ -155,13 +155,19 @@ main()
size_t n_bytes;
SerdNodeFlags flags;
- const size_t len = serd_strlen(str, &n_bytes, &flags);
+ size_t len = serd_strlen(str, &n_bytes, &flags);
if (len != 5 || n_bytes != 7
|| flags != (SERD_HAS_QUOTE|SERD_HAS_NEWLINE)) {
fprintf(stderr, "Bad serd_strlen(%s) len=%zu n_bytes=%zu flags=%u\n",
str, len, n_bytes, flags);
return 1;
}
+ len = serd_strlen(str, NULL, &flags);
+ if (len != 5) {
+ fprintf(stderr, "Bad serd_strlen(%s) len=%zu flags=%u\n",
+ str, len, flags);
+ return 1;
+ }
// Test serd_strerror
@@ -177,6 +183,7 @@ main()
return 1;
}
}
+ msg = serd_strerror((SerdStatus)-1);
// Test serd_uri_to_path
@@ -200,6 +207,37 @@ main()
fprintf(stderr, "Bad path %s for %s\n", serd_uri_to_path(uri), uri);
return 1;
}
+ uri = (const uint8_t*)"file:///c:awful/system";
+ if (strcmp((const char*)serd_uri_to_path(uri), "/c:awful/system")) {
+ fprintf(stderr, "Bad path %s for %s\n", serd_uri_to_path(uri), uri);
+ return 1;
+ }
+ uri = (const uint8_t*)"file:///0/1";
+ if (strcmp((const char*)serd_uri_to_path(uri), "/0/1")) {
+ fprintf(stderr, "Bad path %s for %s\n", serd_uri_to_path(uri), uri);
+ return 1;
+ }
+
+ // Test serd_node_equals
+
+ const uint8_t replacement_char_str[] = { 0xEF, 0xBF, 0xBD, 0 };
+ SerdNode lhs = serd_node_from_string(SERD_LITERAL, replacement_char_str);
+ SerdNode rhs = serd_node_from_string(SERD_LITERAL, USTR("123"));
+ if (serd_node_equals(&lhs, &rhs)) {
+ fprintf(stderr, "%s == %s\n", lhs.buf, rhs.buf);
+ return 1;
+ }
+
+ SerdNode qnode = serd_node_from_string(SERD_CURIE, USTR("foo:bar"));
+ if (serd_node_equals(&lhs, &qnode)) {
+ fprintf(stderr, "%s == %s\n", lhs.buf, qnode.buf);
+ return 1;
+ }
+
+ if (!serd_node_equals(&lhs, &lhs)) {
+ fprintf(stderr, "%s != %s\n", lhs.buf, lhs.buf);
+ return 1;
+ }
// Test serd_node_from_string
@@ -211,13 +249,31 @@ main()
return 1;
}
+ // Test serd_node_new_uri_from_string
+
+ SerdURI base_uri;
+ SerdNode base = serd_node_new_uri_from_string(USTR("http://example.org/"),
+ NULL, &base_uri);
+ SerdNode nil = serd_node_new_uri_from_string(NULL, &base_uri, NULL);
+ if (nil.type != SERD_URI || strcmp((const char*)nil.buf, (const char*)base.buf)) {
+ fprintf(stderr, "URI %s != base %s\n", nil.buf, base.buf);
+ return 1;
+ }
+ serd_node_free(&base);
+ serd_node_free(&nil);
+
// Test SerdEnv
SerdNode u = serd_node_from_string(SERD_URI, USTR("http://example.org/foo"));
SerdNode b = serd_node_from_string(SERD_CURIE, USTR("invalid"));
- SerdNode c = serd_node_from_string(SERD_CURIE, USTR("eg:b"));
+ SerdNode c = serd_node_from_string(SERD_CURIE, USTR("eg.2:b"));
SerdEnv* env = serd_env_new(NULL);
- serd_env_set_prefix_from_strings(env, USTR("eg"), USTR("http://example.org/"));
+ serd_env_set_prefix_from_strings(env, USTR("eg.2"), USTR("http://example.org/"));
+
+ if (!serd_env_set_base_uri(env, &node)) {
+ fprintf(stderr, "Set base URI to %s\n", node.buf);
+ return 1;
+ }
SerdChunk prefix, suffix;
if (!serd_env_expand(env, &b, &prefix, &suffix)) {
@@ -225,6 +281,12 @@ main()
return 1;
}
+ SerdNode xnode = serd_env_expand_node(env, &node);
+ if (!serd_node_equals(&xnode, &SERD_NODE_NULL)) {
+ fprintf(stderr, "Expanded %s to %s\n", c.buf, xnode.buf);
+ return 1;
+ }
+
SerdNode xu = serd_env_expand_node(env, &u);
if (strcmp((const char*)xu.buf, "http://example.org/foo")) {
fprintf(stderr, "Expanded %s to %s\n", c.buf, xu.buf);
@@ -232,6 +294,13 @@ main()
}
serd_node_free(&xu);
+ SerdNode badpre = serd_node_from_string(SERD_CURIE, USTR("hm:what"));
+ SerdNode xbadpre = serd_env_expand_node(env, &badpre);
+ if (!serd_node_equals(&xbadpre, &SERD_NODE_NULL)) {
+ fprintf(stderr, "Expanded invalid curie %s\n", badpre.buf);
+ return 1;
+ }
+
SerdNode xc = serd_env_expand_node(env, &c);
if (strcmp((const char*)xc.buf, "http://example.org/b")) {
fprintf(stderr, "Expanded %s to %s\n", c.buf, xc.buf);
@@ -251,13 +320,20 @@ main()
}
int n_prefixes = 0;
- serd_env_set_prefix_from_strings(env, USTR("eg"), USTR("http://example.org/"));
+ serd_env_set_prefix_from_strings(env, USTR("eg.2"), USTR("http://example.org/"));
serd_env_foreach(env, count_prefixes, &n_prefixes);
if (n_prefixes != 1) {
fprintf(stderr, "Bad prefix count %d\n", n_prefixes);
return 1;
}
+ SerdNode shorter_uri = serd_node_from_string(SERD_URI, USTR("urn:foo"));
+ SerdNode prefix_name;
+ if (serd_env_qualify(env, &shorter_uri, &prefix_name, &suffix)) {
+ fprintf(stderr, "Qualified %s\n", shorter_uri.buf);
+ return 1;
+ }
+
// Test SerdReader and SerdWriter
const char* path = tmpnam(NULL);
@@ -277,6 +353,19 @@ main()
return 1;
}
+ serd_writer_chop_blank_prefix(writer, USTR("tmp"));
+ serd_writer_chop_blank_prefix(writer, NULL);
+
+ if (!serd_writer_set_base_uri(writer, &lit)) {
+ fprintf(stderr, "Set base URI to %s\n", lit.buf);
+ return 1;
+ }
+
+ if (!serd_writer_set_prefix(writer, &lit, &lit)) {
+ fprintf(stderr, "Set prefix %s to %s\n", lit.buf, lit.buf);
+ return 1;
+ }
+
if (!serd_writer_end_anon(writer, NULL)) {
fprintf(stderr, "Ended non-existent anonymous node\n");
return 1;
@@ -288,20 +377,43 @@ main()
SerdNode o = serd_node_from_string(SERD_LITERAL, buf);
// Write 3 invalid statements (should write nothing)
- if (!serd_writer_write_statement(writer, 0, NULL,
- &s, &p, NULL, NULL, NULL)) {
- fprintf(stderr, "Successfully wrote junk statement 1\n");
- return 1;
- }
- if (!serd_writer_write_statement(writer, 0, NULL,
- &s, &p, &SERD_NODE_NULL, NULL, NULL)) {
- fprintf(stderr, "Successfully wrote junk statement 1\n");
+ const SerdNode* junk[][5] = { { &s, &p, NULL, NULL, NULL },
+ { &s, NULL, &o, NULL, NULL },
+ { NULL, &p, &o, NULL, NULL },
+ { &s, &p, &SERD_NODE_NULL, NULL, NULL },
+ { &s, &SERD_NODE_NULL, &o, NULL, NULL },
+ { &SERD_NODE_NULL, &p, &o, NULL, NULL },
+ { &s, &o, &o, NULL, NULL },
+ { &o, &p, &o, NULL, NULL },
+ { NULL, NULL, NULL, NULL, NULL } };
+ for (unsigned i = 0; i < sizeof(junk) / (sizeof(SerdNode*) * 5); ++i) {
+ if (!serd_writer_write_statement(
+ writer, 0, NULL,
+ junk[i][0], junk[i][1], junk[i][2], junk[i][3], junk[i][4])) {
+ fprintf(stderr, "Successfully wrote junk statement %d\n", i);
return 1;
+ }
}
- if (!serd_writer_write_statement(writer, 0, NULL,
- &s, &o, &o, NULL, NULL)) {
- fprintf(stderr, "Successfully wrote junk statement 3\n");
- return 1;
+
+ const SerdNode t = serd_node_from_string(SERD_URI, USTR("urn:Type"));
+ const SerdNode l = serd_node_from_string(SERD_LITERAL, USTR("en"));
+ const SerdNode* good[][5] = { { &s, &p, &o, NULL, NULL },
+ { &s, &p, &o, &SERD_NODE_NULL, &SERD_NODE_NULL },
+ { &s, &p, &o, &t, NULL },
+ { &s, &p, &o, NULL, &l },
+ { &s, &p, &o, &t, &l },
+ { &s, &p, &o, &t, &SERD_NODE_NULL },
+ { &s, &p, &o, &SERD_NODE_NULL, &l },
+ { &s, &p, &o, NULL, &SERD_NODE_NULL },
+ { &s, &p, &o, &SERD_NODE_NULL, NULL },
+ { &s, &p, &o, &SERD_NODE_NULL, NULL } };
+ for (unsigned i = 0; i < sizeof(good) / (sizeof(SerdNode*) * 5); ++i) {
+ if (serd_writer_write_statement(
+ writer, 0, NULL,
+ good[i][0], good[i][1], good[i][2], good[i][3], good[i][4])) {
+ fprintf(stderr, "Failed to write good statement %d\n", i);
+ return 1;
+ }
}
// Write 1 statement with bad UTF-8 (should be replaced)
@@ -334,6 +446,9 @@ main()
return 1;
}
+ serd_reader_add_blank_prefix(reader, USTR("tmp"));
+ serd_reader_add_blank_prefix(reader, NULL);
+
if (!serd_reader_read_file(reader, USTR("http://notafile"))) {
fprintf(stderr, "Apparently read an http URI\n");
return 1;
@@ -348,11 +463,16 @@ main()
return 1;
}
- if (*n_statements != 2) {
+ if (*n_statements != 12) {
fprintf(stderr, "Bad statement count %d\n", *n_statements);
return 1;
}
+ if (!serd_reader_read_string(reader, USTR("This isn't Turtle at all."))) {
+ fprintf(stderr, "Parsed invalid string successfully.\n");
+ return 1;
+ }
+
serd_reader_free(reader);
fclose(fd);
diff --git a/tests/test-backspace.out b/tests/test-backspace.out
index ae8d3678..ad4806cf 100644
--- a/tests/test-backspace.out
+++ b/tests/test-backspace.out
@@ -1 +1,2 @@
<http://example.org/thing> <http://example.org/label> "\u0008" .
+<http://example.org/thing> <http://example.org/label> "\uFFFD" .
diff --git a/tests/test-backspace.ttl b/tests/test-backspace.ttl
index 0e695a88..07375d76 100644
--- a/tests/test-backspace.ttl
+++ b/tests/test-backspace.ttl
@@ -1 +1,2 @@
-<http://example.org/thing> <http://example.org/label> "\u0008" . \ No newline at end of file
+<http://example.org/thing> <http://example.org/label> "\u0008" .
+<http://example.org/thing> <http://example.org/label> "" . \ No newline at end of file
diff --git a/tests/test-cr.out b/tests/test-cr.out
new file mode 100644
index 00000000..aea1655b
--- /dev/null
+++ b/tests/test-cr.out
@@ -0,0 +1 @@
+<http://example.org/thing> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
diff --git a/tests/test-cr.ttl b/tests/test-cr.ttl
new file mode 100644
index 00000000..5410648a
--- /dev/null
+++ b/tests/test-cr.ttl
@@ -0,0 +1,2 @@
+#Test <http://example.org/thing> a <http://example.org/Thing> .
+
diff --git a/tests/test-delete.out b/tests/test-delete.out
new file mode 100644
index 00000000..41ac8062
--- /dev/null
+++ b/tests/test-delete.out
@@ -0,0 +1,2 @@
+<http://example.org/thing> <http://example.org/label> "\u007F" .
+<http://example.org/thing> <http://example.org/label> "\u007F" .
diff --git a/tests/test-delete.ttl b/tests/test-delete.ttl
new file mode 100644
index 00000000..4bc97060
--- /dev/null
+++ b/tests/test-delete.ttl
@@ -0,0 +1,2 @@
+<http://example.org/thing> <http://example.org/label> "\u007F" .
+<http://example.org/thing> <http://example.org/label> "" .
diff --git a/tests/test-eof-at-page-end.out b/tests/test-eof-at-page-end.out
new file mode 100644
index 00000000..64d24586
--- /dev/null
+++ b/tests/test-eof-at-page-end.out
@@ -0,0 +1 @@
+<http://example.org/thing> <http://example.org/comment> "\n0123456789012345678901234567890123456789\n\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567890123456789012345678901234567890123456789\n01234567" .
diff --git a/tests/test-eof-at-page-end.ttl b/tests/test-eof-at-page-end.ttl
new file mode 100644
index 00000000..d6d9af26
--- /dev/null
+++ b/tests/test-eof-at-page-end.ttl
@@ -0,0 +1,85 @@
+<http://example.org/thing> <http://example.org/comment> """
+0123456789012345678901234567890123456789
+
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567890123456789012345678901234567890123456789
+01234567""" . \ No newline at end of file
diff --git a/tests/test-lang.out b/tests/test-lang.out
index c36dda42..61daecb3 100644
--- a/tests/test-lang.out
+++ b/tests/test-lang.out
@@ -2,3 +2,4 @@
<http://example.org/test-lang#thing> <http://example.org/test-lang#greeting> "Howdy"@en-us .
<http://example.org/test-lang#thing> <http://example.org/test-lang#greeting> "Bonjour"@fr .
<http://example.org/test-lang#thing> <http://example.org/test-lang#greeting> "Guten Tag"@de-latn-de .
+<http://example.org/test-lang#thing> <http://example.org/test-lang#greeting> "HEY MAN"@en-crazy0place .
diff --git a/tests/test-lang.ttl b/tests/test-lang.ttl
index f7c2727f..b0616475 100644
--- a/tests/test-lang.ttl
+++ b/tests/test-lang.ttl
@@ -3,4 +3,5 @@
:thing :greeting "Hello"@en ;
:greeting "Howdy"@en-us ;
:greeting "Bonjour"@fr ;
- :greeting "Guten Tag"@de-latn-de .
+ :greeting "Guten Tag"@de-latn-de ;
+ :greeting "HEY MAN"@en-crazy0place .
diff --git a/tests/test-list.out b/tests/test-list.out
new file mode 100644
index 00000000..3a27a5a6
--- /dev/null
+++ b/tests/test-list.out
@@ -0,0 +1 @@
+<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/List> .
diff --git a/tests/test-list.ttl b/tests/test-list.ttl
new file mode 100644
index 00000000..7f4c7699
--- /dev/null
+++ b/tests/test-list.ttl
@@ -0,0 +1 @@
+() a <http://example.org/List> . \ No newline at end of file
diff --git a/tests/test-no-spaces.out b/tests/test-no-spaces.out
new file mode 100644
index 00000000..3619a5f0
--- /dev/null
+++ b/tests/test-no-spaces.out
@@ -0,0 +1,4 @@
+<http://example.org/s> <http://example.org/p> <http://example.org/o> .
+<http://example.org/s> <http://example.org/p2> <http://example.org/o2> .
+<http://example.org/s> <http://example.org/p2> <http://example.org/o3> .
+<http://example.org/s> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
diff --git a/tests/test-no-spaces.ttl b/tests/test-no-spaces.ttl
new file mode 100644
index 00000000..88171e71
--- /dev/null
+++ b/tests/test-no-spaces.ttl
@@ -0,0 +1,3 @@
+@prefix eg: <http://example.org/> .
+eg:s eg:p eg:o;eg:p2 eg:o2,eg:o3 .
+eg:s a<http://example.org/Thing> . \ No newline at end of file
diff --git a/tests/test-num.out b/tests/test-num.out
index 2502580b..54263d46 100644
--- a/tests/test-num.out
+++ b/tests/test-num.out
@@ -7,3 +7,4 @@
<http://example.org/eg#thing> <http://example.org/eg#num> "1.58490e-05"^^<http://www.w3.org/2001/XMLSchema#double> .
<http://example.org/eg#thing> <http://example.org/eg#num> "1.58490e+05"^^<http://www.w3.org/2001/XMLSchema#double> .
<http://example.org/eg#thing> <http://example.org/eg#num> "1.58490e05"^^<http://www.w3.org/2001/XMLSchema#double> .
+<http://example.org/eg#thing> <http://example.org/eg#num> "1.58490E05"^^<http://www.w3.org/2001/XMLSchema#double> .
diff --git a/tests/test-num.ttl b/tests/test-num.ttl
index 54a425ac..68ad290b 100644
--- a/tests/test-num.ttl
+++ b/tests/test-num.ttl
@@ -9,3 +9,4 @@ eg:thing eg:num -.6 .
eg:thing eg:num 1.58490e-05 .
eg:thing eg:num 1.58490e+05 .
eg:thing eg:num 1.58490e05 .
+eg:thing eg:num 1.58490E05 .
diff --git a/tests/test-prefix.out b/tests/test-prefix.out
index 9e166588..bcfdd4b6 100644
--- a/tests/test-prefix.out
+++ b/tests/test-prefix.out
@@ -1,2 +1,6 @@
<http://example.org/a/b> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
<http://example.org/a/b/c> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
+<http://example.org/a/num0num> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
+<http://example.org/a/under_under> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
+<http://example.org/a/dash-dash> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
+<http://example.org/a/.invalidname.> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
diff --git a/tests/test-prefix.ttl b/tests/test-prefix.ttl
index a1d22122..f79896cb 100644
--- a/tests/test-prefix.ttl
+++ b/tests/test-prefix.ttl
@@ -1,4 +1,8 @@
@prefix eg: <http://example.org/a/> .
<http://example.org/a/b> a <http://example.org/Thing> .
-<http://example.org/a/b/c> a <http://example.org/Thing> . \ No newline at end of file
+<http://example.org/a/b/c> a <http://example.org/Thing> .
+<http://example.org/a/num0num> a <http://example.org/Thing> .
+<http://example.org/a/under_under> a <http://example.org/Thing> .
+<http://example.org/a/dash-dash> a <http://example.org/Thing> .
+<http://example.org/a/.invalidname.> a <http://example.org/Thing> .
diff --git a/tests/test-uri.out b/tests/test-uri.out
index 8c984f79..8fd5dd87 100644
--- a/tests/test-uri.out
+++ b/tests/test-uri.out
@@ -35,6 +35,7 @@
<http://a/b/c/g#s/./x> <http://www.w3.org/2002/07/owl#sameAs> <http://a/b/c/g#s/./x> .
<http://a/b/c/g#s/../x> <http://www.w3.org/2002/07/owl#sameAs> <http://a/b/c/g#s/../x> .
<http://a/.g> <http://www.w3.org/2002/07/owl#sameAs> <http://a/.g> .
+<http://a/..g> <http://www.w3.org/2002/07/owl#sameAs> <http://a/..g> .
<http://A?aquery> <http://www.w3.org/2002/07/owl#sameAs> <http://A?aquery> .
<http://A#afragment> <http://www.w3.org/2002/07/owl#sameAs> <http://A#afragment> .
<http://a/b/c/d;p?aquery> <http://www.w3.org/2002/07/owl#sameAs> <http://a/b/c/d;p?aquery> .
diff --git a/tests/test-uri.ttl b/tests/test-uri.ttl
index cbc699ab..8e4f5102 100644
--- a/tests/test-uri.ttl
+++ b/tests/test-uri.ttl
@@ -52,6 +52,7 @@
# Additional tests for Serd
</.g> owl:sameAs <http://a/.g> .
+</..g> owl:sameAs <http://a/..g> .
<http://A?aquery> owl:sameAs <http://A?aquery> .
<http://A#afragment> owl:sameAs <http://A#afragment> .
<?aquery> owl:sameAs <http://a/b/c/d;p?aquery> .
diff --git a/tests/test-utf8-uri.out b/tests/test-utf8-uri.out
new file mode 100644
index 00000000..b8a73a88
--- /dev/null
+++ b/tests/test-utf8-uri.out
@@ -0,0 +1 @@
+<http://example.org/math/\u2200x\u2208\u211D> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Thing> .
diff --git a/tests/test-utf8-uri.ttl b/tests/test-utf8-uri.ttl
new file mode 100644
index 00000000..51f26ff2
--- /dev/null
+++ b/tests/test-utf8-uri.ttl
@@ -0,0 +1 @@
+<http://example.org/math/∀x∈ℝ> a <http://example.org/Thing> . \ No newline at end of file