diff options
Diffstat (limited to 'tests/serd_test.c')
-rw-r--r-- | tests/serd_test.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index e8d535a3..dbadb5bf 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -123,6 +123,23 @@ check_rel_uri(const char* uri, return ret; } +static int +test_get_blank(void) +{ + SerdWorld* world = serd_world_new(); + char expected[8]; + + for (unsigned i = 0; i < 32; ++i) { + const SerdNode* blank = serd_world_get_blank(world); + + snprintf(expected, sizeof(expected), "b%u", i + 1); + assert(!strcmp(serd_node_get_string(blank), expected)); + } + + serd_world_free(world); + return 0; +} + int main(void) { @@ -379,6 +396,10 @@ main(void) SerdWorld* world = serd_world_new(); + if (test_get_blank()) { + return 1; + } + SerdNode* u = serd_node_new_uri("http://example.org/foo"); SerdNode* b = serd_node_new_curie("invalid"); SerdNode* c = serd_node_new_curie("eg.2:b"); |