Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test cases to excercise Gotta Snatch'Em All #684

Closed
nico-or opened this issue Apr 24, 2024 · 1 comment
Closed

Add test cases to excercise Gotta Snatch'Em All #684

nico-or opened this issue Apr 24, 2024 · 1 comment
Labels
good first issue Good task for first-time contributors, has a special meaning for GitHub x:action/improve Improve existing functionality/content x:size/small Small amount of work

Comments

@nico-or
Copy link
Contributor

nico-or commented Apr 24, 2024

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.

@jiegillet
Copy link
Contributor

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 jiegillet added good first issue Good task for first-time contributors, has a special meaning for GitHub x:action/improve Improve existing functionality/content x:size/small Small amount of work labels Apr 25, 2024
nico-or added a commit to nico-or/elm that referenced this issue Apr 26, 2024
Add a test case for totalCards using a singleton list as input since there it wasn't any before.

Discussed in issue exercism#684
jiegillet pushed a commit that referenced this issue May 3, 2024
* Add test case for Gotta Snatch'Em All

Add a test case for totalCards using a singleton list as input since there it wasn't any before.

Discussed in issue #684

* fix test description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good task for first-time contributors, has a special meaning for GitHub x:action/improve Improve existing functionality/content x:size/small Small amount of work
Projects
None yet
Development

No branches or pull requests

2 participants