Skip to content

Update series tests and example #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BNAndras
Copy link
Member

No canonical tests were being used hence the almost complete overhaul. There is only one completion for this exercise to date so we won't break a whole lot here.

I implemented all the tests, but we can discuss that. Do we want the error validation tests? Should they be errors or should we return false values here.

I kept the expected argument order the same from before even though the problem specs has the series first and then the slice. Should we swap?

Does series:from-string make sense as a name? The tested property is slices so we can change it.

@BNAndras BNAndras requested a review from a team June 10, 2025 05:08
@BNAndras BNAndras added x:action/sync Sync content with its latest version x:rep/small Small amount of reputation labels Jun 10, 2025
Copy link

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@yurrriq
Copy link
Member

yurrriq commented Jun 20, 2025

I kept the expected argument order the same from before even though the problem specs has the series first and then the slice. Should we swap?

Given sublist(List1, Start, Len), I'd say aligning with the problem spec makes sense.

Of course it's questionably pedantic for such a simple exercise, but the updated example allocates some unnecessary lists and to me doesn't feel very idiomatic for the BEAM. Instead, I think we should prefer to stick closer to the Erlang example, though there we have the arguments swapped with respect to the problem spec.

Aside: The "slice" language is unfortunate as the documentation usually refers to such data as sublists, while strings:slice/2 carries a different meaning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/sync Sync content with its latest version x:rep/small Small amount of reputation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants