diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 23 |
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 |