Update ellens-alien-game test to prevent returning an empty list from the factory #4001
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I recognize that community contributions are not being accepted, and expect this PR to be automatically closed (as the docs say it will be)
I'm publishing it anyway so I have something to link to in the community thread
Before this change, you can pass the tests for
new_aliens_collection
by returning an empty list. After this change, the returned list must have the same length as the input list (so you create the same number of Aliens as the input asks for).Here is a sample solution that passes all the tests (but incorrectly returns an empty list from the factory method)
I would have expected a test failure, but got none (all tests passing).
After this change, the above code causes one test to fail:
After this change, as expected, when the
new_aliens_collection
method is implemented, the tests pass