go icon indicating copy to clipboard operation
go copied to clipboard

card-tricks: Check if index is >= len(slice)

Open CodeBleu opened this issue 1 year ago • 1 comments

Adjusting so the test will now fail if the index value is greater than or equal to the size of the slice.

CodeBleu avatar Feb 24 '24 01:02 CodeBleu

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


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[bot] avatar Feb 24 '24 01:02 github-actions[bot]

Hey @CodeBleu.

Sorry for the delay in reviewing this. Still interested in working on this?

In this case, I'd suggest to add a new test where the index is strictly bigger than len(slice). That way we have a test for when the index is equal to len(slice) and another one for when it is bigger.

andrerfcsantos avatar Jul 24 '24 23:07 andrerfcsantos

@andrerfcsantos Does there really need to be 2 tests? Not sure what the benefit is, if an = or > value is used. There would not be any use case to just check for =, right? Both will fail. Maybe I'm missing something, but I don't see it any different than writing a test that checks for a specific number greater than either...hence just test for >

CodeBleu avatar Jul 24 '24 23:07 CodeBleu