aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_node.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_node.c b/test/test_node.c
index fc9f1151..b7d43972 100644
--- a/test/test_node.c
+++ b/test/test_node.c
@@ -132,6 +132,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)
{
assert(!serd_new_blob(&SERD_URI_NULL, 0, false, NULL));
@@ -303,6 +323,7 @@ main(void)
test_double_to_node();
test_integer_to_node();
test_blob_to_node();
+ test_boolean();
test_node_equals();
test_node_from_string();
test_node_from_substring();