Matrix: Ensure whole matrix is correct #2195
Closed
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.
There are some proposed solutions where the mentee submit solution that would emit extra empty rows. For instance with an off by one error in a for-loop.
By checking that the whole matrix is exactly as expected we can catch such mistakes.
For the record this was discussed in the following thread; https://forum.exercism.org/t/pull-requrest-on-exercism-javascript/3440/3
Detailed summary from the thread
For instance the following solution will fail nearly all newer
columns
tests while it currently pass those tests:The issue is that the user is iterating on
this.rows.length
instead ofthis.rows[0].length
. And the user is using<=
over<
.Those are the failing tests:
Also, I do not know if this expected but the JS test suite has one more test:
https://github.com/homersimpsons/javascript/blob/f9f722fc7c4b6ab3d700178f076e305784ba686b/exercises/practice/matrix/matrix.spec.js#L34-L36
NB: A Pull Request is already opened on the
exercism/javascript
repository: https://github.com/exercism/javascript/pull/2065/files