From 139df57f1ad6c56de90a658c1cb90b0de9601931 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sat, 6 Mar 2021 22:33:27 +0800 Subject: [PATCH] rename --- .../map/{hashmap_list.scad => hashmap_entries.scad} | 2 +- test/util/map/test_hashmap.scad | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) rename src/util/map/{hashmap_list.scad => hashmap_entries.scad} (65%) diff --git a/src/util/map/hashmap_list.scad b/src/util/map/hashmap_entries.scad similarity index 65% rename from src/util/map/hashmap_list.scad rename to src/util/map/hashmap_entries.scad index ceff6a40..24f7210b 100644 --- a/src/util/map/hashmap_list.scad +++ b/src/util/map/hashmap_entries.scad @@ -1,4 +1,4 @@ -function hashmap_list(map) = [ +function hashmap_entries(map) = [ for(bucket = map) for(kv = bucket) kv diff --git a/test/util/map/test_hashmap.scad b/test/util/map/test_hashmap.scad index c8079b74..ae55d56a 100644 --- a/test/util/map/test_hashmap.scad +++ b/test/util/map/test_hashmap.scad @@ -1,5 +1,5 @@ use ; -use ; +use ; use ; use ; use ; @@ -17,17 +17,17 @@ module test_hashmap() { assert(hashmap_len(s) == 4); - assert(hashmap_list(s) == [["k9876", 3], ["k4444", 3], ["k1234", 1], ["k5678", 2]]); + assert(hashmap_entries(s) == [["k9876", 3], ["k4444", 3], ["k1234", 1], ["k5678", 2]]); s2 = hashmap_put(s, "k1357", 100); - assert(hashmap_list(s2) == [["k9876", 3], ["k4444", 3], ["k1234", 1], ["k5678", 2], ["k1357", 100]]); + assert(hashmap_entries(s2) == [["k9876", 3], ["k4444", 3], ["k1234", 1], ["k5678", 2], ["k1357", 100]]); s3 = hashmap_put(s2, "k5678", 200); - assert(hashmap_list(s3) == [["k9876", 3], ["k4444", 3], ["k1234", 1], ["k5678", 200], ["k1357", 100]]); + assert(hashmap_entries(s3) == [["k9876", 3], ["k4444", 3], ["k1234", 1], ["k5678", 200], ["k1357", 100]]); s4 = hashmap_del(s3, "k4444"); - assert(hashmap_list(s4) == [["k9876", 3], ["k1234", 1], ["k5678", 200], ["k1357", 100]]); - assert(hashmap_list(hashmap_del(s4, "k4444")) == [["k9876", 3], ["k1234", 1], ["k5678", 200], ["k1357", 100]]); + assert(hashmap_entries(s4) == [["k9876", 3], ["k1234", 1], ["k5678", 200], ["k1357", 100]]); + assert(hashmap_entries(hashmap_del(s4, "k4444")) == [["k9876", 3], ["k1234", 1], ["k5678", 200], ["k1357", 100]]); assert(hashmap_get(s4, "k1234") == 1); assert(hashmap_get(s4, "k0000") == undef);