From 220b6ce60aa143446f115980a459d8745f1225a1 Mon Sep 17 00:00:00 2001 From: Ruslan Ustits Date: Wed, 29 May 2024 08:40:18 +0100 Subject: Add is_empty to dict --- test/gleam/dict_test.gleam | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') 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() -- cgit v1.2.3