From 46444ebcf6b128ca9fa4c4919744724f964e0f4c Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Mon, 10 Apr 2023 10:29:09 +0100 Subject: Peter's bug --- test/gleam/map_test.gleam | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test') diff --git a/test/gleam/map_test.gleam b/test/gleam/map_test.gleam index 43e17a0..5cfb37d 100644 --- a/test/gleam/map_test.gleam +++ b/test/gleam/map_test.gleam @@ -336,3 +336,28 @@ pub fn size_test() { |> map.size() |> should.equal(18) } + +// https://github.com/gleam-lang/stdlib/issues/435 +pub fn peters_bug_test() { + map.new() + |> map.insert(22, Nil) + |> map.insert(21, Nil) + |> map.insert(23, Nil) + |> map.insert(18, Nil) + |> map.insert(17, Nil) + |> map.insert(19, Nil) + |> map.insert(14, Nil) + |> map.insert(13, Nil) + |> map.insert(15, Nil) + |> map.insert(10, Nil) + |> map.insert(9, Nil) + |> map.insert(11, Nil) + |> map.insert(6, Nil) + |> map.insert(5, Nil) + |> map.insert(7, Nil) + |> map.insert(2, Nil) + |> map.insert(1, Nil) + |> map.insert(3, Nil) + |> map.get(0) + |> should.equal(Error(Nil)) +} -- cgit v1.2.3