introduce MapSet.size/1 earlier

specifically, before it is used to show sets do not have duplicates
This commit is contained in:
Cohen Carlisle
2018-03-01 13:49:08 -05:00
parent 18ce1752d4
commit 432988014a
2 changed files with 5 additions and 5 deletions

View File

@@ -9,6 +9,10 @@ defmodule MapSets do
assert Enum.fetch(@set, 0) == {:ok, ___} assert Enum.fetch(@set, 0) == {:ok, ___}
end end
koan "How large is my map set?" do
assert MapSet.size(@set) == ___
end
koan "However, I do not allow duplication" do koan "However, I do not allow duplication" do
new_set = MapSet.new([1, 1, 2, 3, 3, 3]) new_set = MapSet.new([1, 1, 2, 3, 3, 3])
@@ -56,10 +60,6 @@ defmodule MapSets do
assert MapSet.member?(modified_set, 1) == ___ assert MapSet.member?(modified_set, 1) == ___
end end
koan "How large is my map set?" do
assert MapSet.size(@set) == ___
end
koan "Are these maps twins?" do koan "Are these maps twins?" do
new_set = MapSet.new([1, 2, 3]) new_set = MapSet.new([1, 2, 3])

View File

@@ -5,13 +5,13 @@ defmodule MapSetsTest do
test "MapSets" do test "MapSets" do
answers = [ answers = [
1, 1,
5,
3, 3,
{:multiple, [false, true]}, {:multiple, [false, true]},
true, true,
{:multiple, [true, false]}, {:multiple, [true, false]},
true, true,
false, false,
5,
false, false,
true, true,
7, 7,