Skip to content

saddle-points: update test suite to v1.3#621

Merged
petertseng merged 2 commits intoexercism:masterfrom
Emerentius:saddle_points
Aug 22, 2018
Merged

saddle-points: update test suite to v1.3#621
petertseng merged 2 commits intoexercism:masterfrom
Emerentius:saddle_points

Conversation

@Emerentius
Copy link
Copy Markdown
Contributor

@Emerentius Emerentius commented Aug 14, 2018

This includes tests for a commonly unhandled case when two equally maximum elements
occur in a row that are both minima in their respective columns.

There is another test case already that has two equally maximum elements, but when a student checks only one element in a row and uses a max finder that always returns the right-most element of multiple equally large elements (like Iterator::max), they happen to get the right result by luck.

This also removes the existing implicit order dependence on the output of the student's code.

Copy link
Copy Markdown
Member

@coriolinus coriolinus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Thanks for doing this work, @Emerentius. If you're willing, it would be helpful to open a PR adding this new case in the problem-specifications repo as well, so that other tracks will also be improved.

As with your other PR, I'm happy if another maintainer wants to merge immediatly. I'm on vacation, though, so won't be able to merge this myself before Monday the 27th.

@Emerentius
Copy link
Copy Markdown
Contributor Author

I've copied this test from the python track actually. If I understand the system correctly, I think this exercise's test suite is still from version 1.1 of the problem specifications which have since changed to 1.3.
So I'm thinking, I should just update the exercise's version in Cargo.toml and the rest of the test suite to conform to the new specifications. Is that right?

@coriolinus
Copy link
Copy Markdown
Member

That would be very helpful. Thanks!

@Emerentius Emerentius changed the title saddle-points: add test for edge case saddle-points: update test suite to v1.3 Aug 18, 2018
@Emerentius
Copy link
Copy Markdown
Contributor Author

I've updated the test suite. It was hard to see the matrices when all the rows where kept in one line so I split them apart. Sorry for the diff noise. It turns out that the track had several extensions of the standard tests. I replaced 2 with the overlapping ones from problem-specifications and kept one more around.
While I was at it, I removed all the redundant test_ prefixes of the tests.

adds two new tests:
- test_multiple_saddle_points_in_row
- test_single_row_matrix

some old, additional tests overlap with new tests
replaced the following with standard tests:
- test_non_square_matrix_wide
- test_vector_matrix -> test_single_column_matrix

kept one additional track-specific test:
- test_non_square_matrix_high
Copy link
Copy Markdown
Member

@petertseng petertseng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was hard to see the matrices when all the rows where kept in one line so I split them apart. Sorry for the diff noise.

It would be easier to review if the reformatting were in its own commit so it's easier to tell which changed lines were purely due to reformatting and which changed lines were due to going to 1.3

But since I can just review the entire new product against 1.3, I will just do it that way I suppose. It looks good.

@petertseng petertseng added sync/readme Keep a README in sync with exercism/problem-specifications sync/tests Keep a test suite/version in sync with exercism/problem-specifications labels Aug 22, 2018
@petertseng petertseng merged commit 0656618 into exercism:master Aug 22, 2018
@petertseng
Copy link
Copy Markdown
Member

Great, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sync/readme Keep a README in sync with exercism/problem-specifications sync/tests Keep a test suite/version in sync with exercism/problem-specifications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants