plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
c3ccbc9
— Peter John
2026-11-01T16:39:48+05:30
T2: review — negative Int keys + duplicates regression test
- plum-std/Map.plum +6 -0
plum-std/Map.plum
CHANGED
|
@@ -329,3 +329,9 @@ test "init_int_keys"
|
|
|
329
329
|
test "init_nested_value"
|
|
330
330
|
m := Map(Pair("a", Map(Pair("x", 1))))
|
|
331
331
|
assert m.get("a")!.get("x")! == 1
|
|
332
|
+
|
|
333
|
+
test "init_negative_int_keys_and_duplicates"
|
|
334
|
+
m := Map(Pair(-5, "a"), Pair(-17, "b"), Pair(-5, "c"))
|
|
335
|
+
assert m.length() == 2
|
|
336
|
+
assert m.get(-5)! == "c"
|
|
337
|
+
assert m.get(-17)! == "b"
|