Clarify the koan that shows that MapSets are unordered.

This commit is contained in:
huyz
2017-02-10 23:43:21 -08:00
parent 2cf4ed485b
commit 0b1f19accc

View File

@@ -15,8 +15,11 @@ defmodule MapSets do
assert MapSet.size(new_set) == ___
end
koan "Even though I am like a list I am unordered after 32 elements" do
assert 1..33 |> MapSet.new() |> Enum.fetch(0) == {___, 11}
koan "Even though I am like a list I am unordered, especially with 33+ elements" do
new_set = MapSet.new 1..33
ordered_list = Enum.to_list 1..33
assert (ordered_list == MapSet.to_list(new_set)) == __
assert (ordered_list == MapSet.to_list(new_set) |> Enum.sort()) == __
end
koan "Does this value exist in the map set?" do