aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-30 17:31:10 +0200
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commita938b755197e8a2ea660cfae1b1ef160e8d59e11 (patch)
treef7cc470af4109c23e8b8a6d1e4f0ed63cb8e4e35 /tests
parent2f8014934fc8f4c6946bf81fe3898c39db611261 (diff)
downloadserd-a938b755197e8a2ea660cfae1b1ef160e8d59e11.tar.gz
serd-a938b755197e8a2ea660cfae1b1ef160e8d59e11.tar.bz2
serd-a938b755197e8a2ea660cfae1b1ef160e8d59e11.zip
Add serd_env_copy() and serd_env_equals()
Diffstat (limited to 'tests')
-rw-r--r--tests/env_test.c19
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);