Hello @MatthijsBlom ,
Thank you for your answer.
Can you provide specific examples of plausible solutions that pass but should fail?
For instance the following solution will fail nearly all newer columns
tests while it currently pass those tests:
export class Matrix {
constructor(matrix) {
this.matrix = matrix
}
get rows() {
return this.matrix
.split('\n')
.map(row => row.split(' ').map(entry => +entry));
}
get columns() {
const columns = [];
for (let i = 0; i <= this.rows.length; i++) {
columns[i] = this.rows.map((row) => {
return row[i];
});
}
return columns;
}
}
The issue is that the user is iterating on this.rows.length
instead of this.rows[0].length
.
Those are the failing tests:
// extract column from one number matrix
expected: [[1]]
received: [[1], [undefined]]
// can extract column
expected: [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
received: [[1, 4, 7], [2, 5, 8], [3, 6, 9], [undefined, undefined, undefined]]
// extract column where numbers have different widths
expected: [[89, 18, 9], [1903, 3, 4], [3, 1, 800]]
received: [[89, 18, 9], [1903, 3, 4], [3, 1, 800], [undefined, undefined, undefined]]
In general, I expect added tests to be way more likely to be adopted than changes to tests.
I can update the Merge Requests to add those tests instead of updating the current ones. I was just thinkig that as those are precisions to the tests and alligned with the instructions it would make more sense to just update the current ones.
Do you want me to add those as separate tests ?