aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanny van Kooten <dannyvankooten@users.noreply.github.com>2020-03-18 19:21:48 +0100
committerDanny van Kooten <dannyvankooten@users.noreply.github.com>2020-03-18 19:21:48 +0100
commit8d74fd5b0e5fc9f319a5b7d2e0716afcc312fd75 (patch)
treea6c195d183694304fbe238a68486aceea01d404a /tests
parent82de777afb99aa4129abcb01da76bf62e7b45263 (diff)
downloadunja-8d74fd5b0e5fc9f319a5b7d2e0716afcc312fd75.tar.gz
unja-8d74fd5b0e5fc9f319a5b7d2e0716afcc312fd75.zip
clean-up environment in env_free(). add hashmap_walk function for visiting all values in a hashmap.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_template.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/test_template.c b/tests/test_template.c
index 34022fa..b427f7c 100644
--- a/tests/test_template.c
+++ b/tests/test_template.c
@@ -182,14 +182,13 @@ TEST(for_block_whitespace) {
TEST(var_dot_notation) {
char *input = "Hello {{user.name}}!";
- struct hashmap *user = hashmap_new();
- hashmap_insert(user, "name", "Danny");
-
struct hashmap *ctx = hashmap_new();
+ struct hashmap *user = hashmap_new();
+ hashmap_insert(user, "name", "Danny");
hashmap_insert(ctx, "user", user);
-
char *output = template_string(input, ctx);
assert_str(output, "Hello Danny!");
+ hashmap_free(user);
hashmap_free(ctx);
free(output);
}