diff options
author | Mikko Ahlroth <mikko@ahlroth.fi> | 2023-10-15 14:28:42 +0300 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2023-10-17 12:33:52 +0100 |
commit | a63339014ba5ebd5ad50b34bea53fb39d105ec52 (patch) | |
tree | 4693a4fb7f42182437693428829f29e12725518b /test | |
parent | d0d942ba9fda93a9338483335628fdae82a6fbad (diff) | |
download | gleam_stdlib-a63339014ba5ebd5ad50b34bea53fb39d105ec52.tar.gz gleam_stdlib-a63339014ba5ebd5ad50b34bea53fb39d105ec52.zip |
Fix map equality checking when the amount of keys differs
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/map_test.gleam | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/gleam/map_test.gleam b/test/gleam/map_test.gleam index 75fb78d..b00331f 100644 --- a/test/gleam/map_test.gleam +++ b/test/gleam/map_test.gleam @@ -375,3 +375,19 @@ pub fn zero_must_be_contained_test() { |> map.has_key(0) |> should.equal(True) } + +pub fn empty_map_equality_test() { + let map1 = map.new() + let map2 = map.from_list([#(1, 2)]) + + should.be_false(map1 == map2) + should.be_false(map2 == map1) +} + +pub fn extra_keys_equality_test() { + let map1 = map.from_list([#(1, 2), #(3, 4)]) + let map2 = map.from_list([#(1, 2), #(3, 4), #(4, 5)]) + + should.be_false(map1 == map2) + should.be_false(map2 == map1) +} |