diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/env_test.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/env_test.c b/tests/env_test.c index e507bfc9..25164701 100644 --- a/tests/env_test.c +++ b/tests/env_test.c @@ -95,6 +95,24 @@ test_env(void) SerdNode* qualified = serd_env_qualify(env, foo_u); assert(serd_node_equals(qualified, foo_c)); + + SerdEnv* env_copy = serd_env_copy(env); + assert(serd_env_equals(env, env_copy)); + assert(!serd_env_equals(env, NULL)); + assert(!serd_env_equals(NULL, env)); + assert(serd_env_equals(NULL, NULL)); + + SerdNode* qualified2 = serd_env_expand(env_copy, foo_u); + assert(serd_node_equals(qualified, foo_c)); + serd_node_free(qualified2); + + serd_env_set_prefix_from_strings( + env_copy, "test", "http://example.org/test"); + assert(!serd_env_equals(env, env_copy)); + + serd_env_set_prefix_from_strings(env, "test2", "http://example.org/test"); + assert(!serd_env_equals(env, env_copy)); + serd_node_free(qualified); serd_node_free(foo_c); serd_node_free(foo_u); @@ -102,6 +120,7 @@ test_env(void) serd_node_free(b); serd_node_free(pre); serd_node_free(eg); + serd_env_free(env_copy); serd_env_free(env); serd_world_free(world); |