Proposal: canonical data for simple linked list

That works for me too.

[simple-linked-list] Add a new canonical data file by IsaacG · Pull Request #2635 · exercism/problem-specifications · GitHub adds canonical data. It has "scenarios": ["toList-lifo"] and "scenarios": ["toList-fifo"]. It recommends selecting whichever is more idiomatic for the track. (I’ll get the tests to pass when I’m back at as computer.)

jq was used to format the file. My Python implementation (with minor tweaks) was used to validate the data. See gift for both Python scrips.

2 Likes

PR updated, tests pass.

Alas, the scenarios must be one of the known scenarios. New scenarios cannot be added arbitrarily. As such, the description and comments will need to suffice to differentiate between the two different toList options.

PR merged. Thanks, everyone!

2 Likes

I was implementing simple-linked-list and I had a bug in the reverse function related to the count. But no tests failed.

I propose to update (one or more of) the reverse tests to perform a count after the reverse.

Thoughts?

To clarify, the reverse then toArray was returning the correct values but the count was off? I would expect toArray to be broken if count is broken ;)

But, yes, I support adding a count after reverse.

My toList implementation walks the list and doesn’t rely on the count.

2 Likes

simple-linked-list: reimplement 1 test to count after reverse by glennj · Pull Request #2636 · exercism/problem-specifications

1 Like

Also more permissive lychee accept statuses by glennj · Pull Request #2637 · exercism/problem-specifications to make link checking more lenient (due to http code 202)

1 Like