exercism / gleam

Exercism exercises in Gleam.
https://exercism.org/tracks/gleam
MIT License
87 stars 79 forks source link

Gotta snatch 'em all shiny card evaluation test #503

Closed Rocche closed 3 months ago

Rocche commented 3 months ago

Hey!

This pull request adds a (useless) not covered case in Gotta Snatch 'Em All` exercise, which is the "fake shiny" card (feel free to name the case the way you like).

Basically the instructions of the last part of the exercise states:

Implement shiny_cards, which takes a collection and returns a set containing all the cards that start with "Shiny ".

That means that cards starting with "Shiny" without a space should not be considered shiny cards. For example, the totally made up card Shinychu should not be considered as shiny. However in the current state of the exercise I could write a function that filters for strings starting with "Shiny" and the tests pass.

To correct this behavior, I added the Shinychu card to all the tests regarding shiny cards. For example:

pub fn shiny_cards_with_none_test() {
  gotta_snatch_em_all.shiny_cards(
    set.from_list(["Blasturtle", "Zumbat", "Hitmonchuck", "Shinychu"]),  // <-- here the added fake shiny card
  )
  |> should.equal(set.new())
}

This is probably a useless correction, but I think it better completes the exercise.

github-actions[bot] commented 3 months ago

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!