Skip to content

Add test case with additional collection for commonCards method#3101

Merged
kahgoh merged 1 commit intoexercism:mainfrom
rabestro:GottaSnatchEmAllTest
Apr 2, 2026
Merged

Add test case with additional collection for commonCards method#3101
kahgoh merged 1 commit intoexercism:mainfrom
rabestro:GottaSnatchEmAllTest

Conversation

@rabestro
Copy link
Copy Markdown
Member

@rabestro rabestro commented Apr 1, 2026

pull request

https://forum.exercism.org/t/gotta-snatch-em-all-wrong-solution-pass-all-tests/36533/5

Summary

  • Improved the tests for the GottaSnatchEmAll exercise to catch faulty implementations of the commonCards method.

Changes

  • Updated testCommonCardsMultipleCollections in GottaSnatchEmAllTest.java by re-ordering the input collections.
  • The new order ensures that a card present in the first two sets but not the third will be incorrectly identified as a common card by a faulty implementation that only checks adjacent sets.

Verification

  • Verified that the reference implementation passes all tests, including the updated one, using the project's test runner.

Reviewer Resources:

Track Policies

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

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!

@kahgoh kahgoh added the x:rep/tiny Tiny amount of reputation label Apr 2, 2026
@kahgoh kahgoh merged commit d7400b3 into exercism:main Apr 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:rep/tiny Tiny amount of reputation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants