From 432988014a364fc5d201e8c0076d0b32b25eccc3 Mon Sep 17 00:00:00 2001 From: Cohen Carlisle Date: Thu, 1 Mar 2018 13:49:08 -0500 Subject: [PATCH 1/2] introduce MapSet.size/1 earlier specifically, before it is used to show sets do not have duplicates --- lib/koans/09_map_sets.ex | 8 ++++---- test/koans/map_sets_koans_test.exs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/koans/09_map_sets.ex b/lib/koans/09_map_sets.ex index b40cca5..3ac5af1 100644 --- a/lib/koans/09_map_sets.ex +++ b/lib/koans/09_map_sets.ex @@ -9,6 +9,10 @@ defmodule MapSets do assert Enum.fetch(@set, 0) == {:ok, ___} end + koan "How large is my map set?" do + assert MapSet.size(@set) == ___ + end + koan "However, I do not allow duplication" do new_set = MapSet.new([1, 1, 2, 3, 3, 3]) @@ -56,10 +60,6 @@ defmodule MapSets do assert MapSet.member?(modified_set, 1) == ___ end - koan "How large is my map set?" do - assert MapSet.size(@set) == ___ - end - koan "Are these maps twins?" do new_set = MapSet.new([1, 2, 3]) diff --git a/test/koans/map_sets_koans_test.exs b/test/koans/map_sets_koans_test.exs index ec6f134..a4c5af2 100644 --- a/test/koans/map_sets_koans_test.exs +++ b/test/koans/map_sets_koans_test.exs @@ -5,13 +5,13 @@ defmodule MapSetsTest do test "MapSets" do answers = [ 1, + 5, 3, {:multiple, [false, true]}, true, {:multiple, [true, false]}, true, false, - 5, false, true, 7, From 3a58b49fe6579d968098b1d2ae58bbf0e5ab0124 Mon Sep 17 00:00:00 2001 From: Cohen Carlisle Date: Fri, 2 Mar 2018 10:18:25 -0500 Subject: [PATCH 2/2] remove elementary MapSet.size/1 koan size is covered under koan "However, I do not allow duplication" --- lib/koans/09_map_sets.ex | 4 ---- test/koans/map_sets_koans_test.exs | 1 - 2 files changed, 5 deletions(-) diff --git a/lib/koans/09_map_sets.ex b/lib/koans/09_map_sets.ex index 3ac5af1..e851900 100644 --- a/lib/koans/09_map_sets.ex +++ b/lib/koans/09_map_sets.ex @@ -9,10 +9,6 @@ defmodule MapSets do assert Enum.fetch(@set, 0) == {:ok, ___} end - koan "How large is my map set?" do - assert MapSet.size(@set) == ___ - end - koan "However, I do not allow duplication" do new_set = MapSet.new([1, 1, 2, 3, 3, 3]) diff --git a/test/koans/map_sets_koans_test.exs b/test/koans/map_sets_koans_test.exs index a4c5af2..886fb41 100644 --- a/test/koans/map_sets_koans_test.exs +++ b/test/koans/map_sets_koans_test.exs @@ -5,7 +5,6 @@ defmodule MapSetsTest do test "MapSets" do answers = [ 1, - 5, 3, {:multiple, [false, true]}, true,