From e438fb6c51a9903db5febdf99bd7fb1fdcd34ed4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 18 Nov 2018 18:26:37 +0100 Subject: Improve node test coverage --- tests/serd_test.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/serd_test.c b/tests/serd_test.c index a96c3537..d6411e4e 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -415,6 +415,8 @@ test_literal(void) assert(!serd_new_typed_literal(NULL, NULL)); SerdNode* hello2 = serd_new_string("hello\""); + assert(!serd_new_typed_literal("bad type", hello2)); + assert(serd_node_get_length(hello2) == 6 && serd_node_get_flags(hello2) == SERD_HAS_QUOTE && !strcmp(serd_node_get_string(hello2), "hello\"")); @@ -422,6 +424,10 @@ test_literal(void) SerdNode* hello3 = serd_new_plain_literal("hello\"", NULL); assert(serd_node_equals(hello2, hello3)); + SerdNode* hello4 = serd_new_typed_literal("hello\"", NULL); + assert(serd_node_equals(hello4, hello2)); + + serd_node_free(hello4); serd_node_free(hello3); serd_node_free(hello2); -- cgit v1.2.1