elm icon indicating copy to clipboard operation
elm copied to clipboard

Add test cases to excercise Gotta Snatch'Em All

Open nico-or opened this issue 1 year ago • 1 comments

In part 7, the instructions is "Implement totalCards, which takes a list of collections and returns the total number of different cards in the all of the collections."

The function signature is: totalCards : List (Collection) -> Int

But reading the test cases, there is no cover for inputs of singleton Lists.

I think adding these inputs should suffice:

  • [Set.empty]
  • [Set.singleton "Shazam"]
  • [Set.fromList [ "Shazam", "Wigglycream" ]]

On the other hand, since this exercise is intended to teach Sets, I don't know if focusing on the proper handling of the List input is appropriate.

nico-or avatar Apr 24 '24 19:04 nico-or

Sure, I think we can add one test in that vein, something like

            , test "totalCards of a single collection" <|
                \() ->
                    GottaSnatchEmAll.totalCards [ Set.fromList [ "Shazam", "Wigglycream" ]]
                        |> Expect.equal 2

Would you like to do it?

jiegillet avatar Apr 24 '24 23:04 jiegillet