diff options
author | Ruslan Ustits <ustitsruslan@gmail.com> | 2024-05-29 08:40:18 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-05-29 10:05:30 +0100 |
commit | 220b6ce60aa143446f115980a459d8745f1225a1 (patch) | |
tree | 6c8ef3689a797296683eb348293e5a35fe08b7b5 /test | |
parent | 99643d8fd40d44b828d8f3298d5282e356709f41 (diff) | |
download | gleam_stdlib-220b6ce60aa143446f115980a459d8745f1225a1.tar.gz gleam_stdlib-220b6ce60aa143446f115980a459d8745f1225a1.zip |
Add is_empty to dict
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/dict_test.gleam | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/gleam/dict_test.gleam b/test/gleam/dict_test.gleam index 0bcb334..9ec1475 100644 --- a/test/gleam/dict_test.gleam +++ b/test/gleam/dict_test.gleam @@ -349,6 +349,23 @@ pub fn size_test() { |> should.equal(18) } +pub fn is_empty_test() { + dict.new() + |> dict.is_empty() + |> should.be_true() + + dict.new() + |> dict.insert(1, 10) + |> dict.is_empty() + |> should.be_false() + + dict.new() + |> dict.insert(1, 10) + |> dict.delete(1) + |> dict.is_empty() + |> should.be_true() +} + // https://github.com/gleam-lang/stdlib/issues/435 pub fn peters_bug_test() { dict.new() |