From 2ddf10fb8bfabff3ecdbe9ea866a905631ec2866 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 26 Dec 2018 11:54:21 -0500 Subject: Add serd_new_boolean() --- test/test_node.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test') diff --git a/test/test_node.c b/test/test_node.c index 968d4ada..f286aa16 100644 --- a/test/test_node.c +++ b/test/test_node.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -117,6 +118,26 @@ test_integer_to_node(void) } } +static void +test_boolean(void) +{ + SerdNode* const true_node = serd_new_boolean(true); + assert(!strcmp(serd_node_string(true_node), "true")); + + const SerdNode* const true_datatype = serd_node_datatype(true_node); + assert(true_datatype); + assert(!strcmp(serd_node_string(true_datatype), NS_XSD "boolean")); + serd_node_free(true_node); + + SerdNode* const false_node = serd_new_boolean(false); + assert(!strcmp(serd_node_string(false_node), "false")); + + const SerdNode* const false_datatype = serd_node_datatype(false_node); + assert(false_datatype); + assert(!strcmp(serd_node_string(false_datatype), NS_XSD "boolean")); + serd_node_free(false_node); +} + static void test_blob_to_node(void) { @@ -302,6 +323,7 @@ main(void) test_new_decimal(); test_integer_to_node(); test_blob_to_node(); + test_boolean(); test_node_equals(); test_node_from_string(); test_node_from_substring(); -- cgit v1.2.1