elm
elm copied to clipboard
Add test cases to excercise Gotta Snatch'Em All
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.
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?