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>2018-11-25 22:12:47 +0100
commit6a95fc336970abdbc9583e6da55ae6c244fc6142 (patch)
tree069b275c7d493c0e1feb2f221aa2f448608f4b0b /tests
parent5a6a76f484cca46d4e788f2e62b9fafb1f5ea6cf (diff)
downloadserd-6a95fc336970abdbc9583e6da55ae6c244fc6142.tar.gz
serd-6a95fc336970abdbc9583e6da55ae6c244fc6142.tar.bz2
serd-6a95fc336970abdbc9583e6da55ae6c244fc6142.zip
Add serd_env_copy() and serd_env_equals()
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index 58e6a3db..29f48cef 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -553,12 +553,35 @@ main(void)
serd_node_get_string(foo_u),
serd_node_get_string(qualified));
}
+
+ SerdEnv* env_copy = serd_env_copy(env);
+ if (!serd_env_equals(env, env_copy)) {
+ FAIL("Copied environment does not equal original\n");
+ }
+
+ SerdNode* qualified2 = serd_env_expand(env_copy, foo_u);
+ if (!serd_node_equals(qualified, foo_c)) {
+ FAIL("Bad environment copy\n");
+ }
+ serd_node_free(qualified2);
+
+ serd_env_set_prefix_from_strings(env_copy, "test", "http://example.org/test");
+ if (serd_env_equals(env, env_copy)) {
+ FAIL("Modified copied environment equals original\n");
+ }
+
+ serd_env_set_prefix_from_strings(env, "test2", "http://example.org/test");
+ if (serd_env_equals(env, env_copy)) {
+ FAIL("Modified copied environment equals original\n");
+ }
+
serd_node_free(qualified);
serd_node_free(foo_c);
serd_node_free(foo_u);
serd_node_free(b);
serd_node_free(pre);
serd_node_free(eg);
+ serd_env_free(env_copy);
// Test SerdReader and SerdWriter