From 8d74fd5b0e5fc9f319a5b7d2e0716afcc312fd75 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Wed, 18 Mar 2020 19:21:48 +0100 Subject: clean-up environment in env_free(). add hashmap_walk function for visiting all values in a hashmap. --- tests/test_template.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests') 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); } -- cgit v1.2.3