diff options
author | David Robillard <d@drobilla.net> | 2018-12-26 11:54:21 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | fe0b6d5d4d78cb31e1bf2381198890d070e46ed1 (patch) | |
tree | 98fdfcb34ee19b766a1ca0d724472522148d9c03 /test | |
parent | 413b4d1f58bdf1d6aed785ae9b076c7b7b9a7350 (diff) | |
download | serd-fe0b6d5d4d78cb31e1bf2381198890d070e46ed1.tar.gz serd-fe0b6d5d4d78cb31e1bf2381198890d070e46ed1.tar.bz2 serd-fe0b6d5d4d78cb31e1bf2381198890d070e46ed1.zip |
Add serd_new_boolean()
Diffstat (limited to 'test')
-rw-r--r-- | test/test_node.c | 21 |
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(); |