aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_hashmap.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_hashmap.c b/tests/test_hashmap.c
index 68b8d0c..d78f768 100644
--- a/tests/test_hashmap.c
+++ b/tests/test_hashmap.c
@@ -15,4 +15,18 @@ TEST(hashmap) {
hashmap_free(hm);
}
+
+TEST(dot_notation) {
+
+ struct hashmap *user = hashmap_new();
+ hashmap_insert(user, "name", "Danny");
+ struct hashmap *hm = hashmap_new();
+ hashmap_insert(hm, "user", user);
+ char *value = (char *) hashmap_resolve(hm, "user.name");
+ assert(value != NULL, "expected value, got NULL");
+ assert(strcmp(value, "Danny") == 0, "expected %s, got %s", "Danny", value);
+
+ hashmap_free(hm);
+}
+
END_TESTS \ No newline at end of file