From 258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 30 Aug 2023 20:43:05 -0400 Subject: Use ZixStringView directly --- test/test_node_syntax.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'test/test_node_syntax.c') diff --git a/test/test_node_syntax.c b/test/test_node_syntax.c index d1d913ec..5e106a94 100644 --- a/test/test_node_syntax.c +++ b/test/test_node_syntax.c @@ -10,9 +10,9 @@ #include "serd/node.h" #include "serd/node_syntax.h" #include "serd/nodes.h" -#include "serd/string_view.h" #include "serd/syntax.h" #include "serd/value.h" +#include "zix/string_view.h" #include #include @@ -64,7 +64,7 @@ check(const SerdSyntax syntax, const char* const expected) { SerdEnv* const env = - serd_env_new(NULL, serd_string("http://example.org/base/")); + serd_env_new(NULL, zix_string("http://example.org/base/")); char* const str = serd_node_to_syntax(NULL, node, syntax, env); SerdNode* const copy = serd_node_from_syntax(NULL, str, syntax, env); @@ -82,33 +82,34 @@ test_common(const SerdSyntax syntax) { static const uint8_t data[] = {19U, 17U, 13U, 7U}; - const SerdStringView datatype = serd_string("http://example.org/Datatype"); + static const ZixStringView datatype = + ZIX_STATIC_STRING("http://example.org/Datatype"); SerdNodes* const nodes = serd_nodes_new(NULL); assert( check(syntax, serd_nodes_get(nodes, serd_a_string("node")), "\"node\"")); - assert(check( - syntax, - serd_nodes_get( - nodes, serd_a_plain_literal(serd_string("hallo"), serd_string("de"))), - "\"hallo\"@de")); + assert( + check(syntax, + serd_nodes_get( + nodes, serd_a_plain_literal(zix_string("hallo"), zix_string("de"))), + "\"hallo\"@de")); assert(check( syntax, - serd_nodes_get(nodes, serd_a_typed_literal(serd_string("X"), datatype)), + serd_nodes_get(nodes, serd_a_typed_literal(zix_string("X"), datatype)), "\"X\"^^")); assert(check(syntax, - serd_nodes_get(nodes, serd_a_blank(serd_string("blank"))), + serd_nodes_get(nodes, serd_a_blank(zix_string("blank"))), "_:blank")); assert(check( - syntax, serd_nodes_get(nodes, serd_a_blank(serd_string("b0"))), "_:b0")); + syntax, serd_nodes_get(nodes, serd_a_blank(zix_string("b0"))), "_:b0")); assert(check(syntax, - serd_nodes_get(nodes, serd_a_blank(serd_string("named1"))), + serd_nodes_get(nodes, serd_a_blank(zix_string("named1"))), "_:named1")); assert(check(syntax, @@ -151,7 +152,7 @@ test_ntriples(void) // If a relative URI can be expanded then all's well SerdEnv* const env = - serd_env_new(NULL, serd_string("http://example.org/base/")); + serd_env_new(NULL, zix_string("http://example.org/base/")); char* const str = serd_node_to_syntax(NULL, rel, SERD_NTRIPLES, env); assert(!strcmp(str, "")); -- cgit v1.2.1