diff options
author | David Robillard <d@drobilla.net> | 2023-08-30 20:43:05 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:08 -0500 |
commit | 258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (patch) | |
tree | d7be35c7b4b3d466049352f2975e2c88c298f4b8 /test/test_node_syntax.c | |
parent | b13ad41a4d65b577b4db67660a9edf3056bdf7af (diff) | |
download | serd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.tar.gz serd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.tar.bz2 serd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.zip |
Use ZixStringView directly
Diffstat (limited to 'test/test_node_syntax.c')
-rw-r--r-- | test/test_node_syntax.c | 27 |
1 files changed, 14 insertions, 13 deletions
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 <assert.h> #include <stdbool.h> @@ -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\"^^<http://example.org/Datatype>")); 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, "<http://example.org/base/rel/uri>")); |