Skip to content

Conversation

@BassTony
Copy link
Contributor

The second test case does not play well with head on line 21, since using head on an empty list yields an error.

Use head only when the list is not empty.

The second case does not play well with `head` on line 21. Perhaps this would fix the broken test case?
@github-actions
Copy link

Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.

That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Jan 29, 2023
@petertseng petertseng reopened this Jan 30, 2023
Copy link
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's pretty hard to actually cause the test to actually evaluate head [], but just to demonstrate it's possible, you can make it happen with saddlePoints arr = if snd (snd (bounds arr)) == 3 then [(2, 1)] else []. Since there is a possible implementation that can make it happen, we should prevent it.

@petertseng petertseng changed the title Fix broken tests saddle-points/test: Do not use head on empty list Jan 30, 2023
@petertseng petertseng merged commit d5f9650 into exercism:main Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants