|
@@ -32,7 +32,7 @@ init_terms (void)
|
|
static nt_str start_nt[TERM_CT] = {
|
|
static nt_str start_nt[TERM_CT] = {
|
|
"<urn:local:s1>",
|
|
"<urn:local:s1>",
|
|
"<http://example.org/p1> ",
|
|
"<http://example.org/p1> ",
|
|
- "\"hello\"^^http://www.w3.org/2001/XMLSchema#string",
|
|
|
|
|
|
+ "\"hello\"^^<http://www.w3.org/2001/XMLSchema#string>",
|
|
"\"hello\" @en-US",
|
|
"\"hello\" @en-US",
|
|
"\"hello\"@es-ES # Does \"Hello\" in Spanish mean \"hola\"?",
|
|
"\"hello\"@es-ES # Does \"Hello\" in Spanish mean \"hola\"?",
|
|
"\"25\" ^^<http://www.w3.org/2001/XMLSchema#integer> ",
|
|
"\"25\" ^^<http://www.w3.org/2001/XMLSchema#integer> ",
|
|
@@ -59,6 +59,9 @@ static nt_str end_nt[TERM_CT] = {
|
|
// Start NT document. It may have comments and junk whitespace.
|
|
// Start NT document. It may have comments and junk whitespace.
|
|
static char *start_doc = (
|
|
static char *start_doc = (
|
|
"<urn:local:s1> <http://example.org/p1> \"hello\" . # Comment here.\n"
|
|
"<urn:local:s1> <http://example.org/p1> \"hello\" . # Comment here.\n"
|
|
|
|
+ "<urn:local:s1> <http://example.org/p1> "
|
|
|
|
+ "\"hello\"^^<http://www.w3.org/2001/XMLSchema#string> .\n"
|
|
|
|
+ "<urn:local:s1> <http://example.org/p1>\"hello\"@en-US .\n"
|
|
"<urn:local:s1> <http://example.org/p1>\"hello\"@es-ES .\n"
|
|
"<urn:local:s1> <http://example.org/p1>\"hello\"@es-ES .\n"
|
|
"# Some comments\n# To make it a bit \n #less boring.\n"
|
|
"# Some comments\n# To make it a bit \n #less boring.\n"
|
|
"<urn:local:s1> <http://example.org/p1> _:bn1 .\n"
|
|
"<urn:local:s1> <http://example.org/p1> _:bn1 .\n"
|
|
@@ -81,8 +84,9 @@ static char *bad_doc = (
|
|
|
|
|
|
// End result NT document as it should be produced by the NT codec.
|
|
// End result NT document as it should be produced by the NT codec.
|
|
// Lines should not be checked in strict order.
|
|
// Lines should not be checked in strict order.
|
|
-static char *end_doc[6] = {
|
|
|
|
|
|
+static char *end_doc[7] = {
|
|
"<urn:local:s1> <http://example.org/p1> \"hello\" .\n",
|
|
"<urn:local:s1> <http://example.org/p1> \"hello\" .\n",
|
|
|
|
+ "<urn:local:s1> <http://example.org/p1> \"hello\"@en-US .\n",
|
|
"<urn:local:s1> <http://example.org/p1> \"hello\"@es-ES .\n",
|
|
"<urn:local:s1> <http://example.org/p1> \"hello\"@es-ES .\n",
|
|
"<urn:local:s1> <http://example.org/p1> _:bn1 .\n",
|
|
"<urn:local:s1> <http://example.org/p1> _:bn1 .\n",
|
|
"_:bn1 <http://example.org/p1> \"hello\"@es-ES .\n",
|
|
"_:bn1 <http://example.org/p1> \"hello\"@es-ES .\n",
|
|
@@ -179,7 +183,7 @@ static int test_encode_nt_graph()
|
|
LSUP_graph_free (gr);
|
|
LSUP_graph_free (gr);
|
|
//printf("Serialized graph: %s\n", out);
|
|
//printf("Serialized graph: %s\n", out);
|
|
|
|
|
|
- for (int i = 0; i < 6; i++)
|
|
|
|
|
|
+ for (int i = 0; i < 7; i++)
|
|
ASSERT (strstr (out, end_doc[i]) != NULL, end_doc[i]);
|
|
ASSERT (strstr (out, end_doc[i]) != NULL, end_doc[i]);
|
|
|
|
|
|
free (out);
|
|
free (out);
|
|
@@ -214,11 +218,14 @@ test_decode_nt_graph()
|
|
fclose (input);
|
|
fclose (input);
|
|
|
|
|
|
ASSERT (err == NULL, "Error string is not NULL!");
|
|
ASSERT (err == NULL, "Error string is not NULL!");
|
|
- EXPECT_INT_EQ (ct, 6);
|
|
|
|
- EXPECT_INT_EQ (LSUP_graph_size (gr), 6);
|
|
|
|
|
|
+ EXPECT_INT_EQ (ct, 8);
|
|
|
|
+ EXPECT_INT_EQ (LSUP_graph_size (gr), 7);
|
|
|
|
|
|
- for (int i = 0; i < 7; i++)
|
|
|
|
|
|
+ for (int i = 0; i < 7; i++) {
|
|
|
|
+ printf("Checking triple #%d... ", i);
|
|
EXPECT_INT_EQ (LSUP_graph_contains (gr, trp + i), 1);
|
|
EXPECT_INT_EQ (LSUP_graph_contains (gr, trp + i), 1);
|
|
|
|
+ printf("OK.\n");
|
|
|
|
+ }
|
|
|
|
|
|
LSUP_graph_free (gr);
|
|
LSUP_graph_free (gr);
|
|
|
|
|