Add new test for grade-school exercise


Opening this discussion as PR was closed by the bot :slight_smile:

I think we can add one more test for the grade-school exercise
Exercise have this description:

Get a sorted list of all students in all grades. Grades should sort as 1, 2, 3, etc., and students within a grade should be sorted alphabetically by name.
“Who all is enrolled in school right now?”
“Let me think. We have Anna, Barb, and Charlie in grade 1, Alex, Peter, and Zoe in grade 2 and Jim in grade 5. So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe and Jim”

Given that all tests are using add function as part of the school preparation, we never test that roster function handles the case when input school was not sorted.

  1. PRs should be discussed prior to being opened. See Pull Requests | Exercism's Docs
  2. Grade school is a practice exercise and the tests are likely synced from the problem spec. See Suggesting Exercise Improvements | Exercism's Docs
  3. This PR looks like it is doing a whole bunch of code formatting. PRs should do one thing at a time, ideally. A format change should be a separate discussion and separate PR from introducing a new test.

Re the formatting: unfortunately this was just a run of dotnet fantomas

At a closer look, this may not fit into the problem spec as it is specific to how F# implements things and not applicable to the general problem.

Unfortunately I do not know much about how exercises are done here, maybe I am suggesting something wrong.
It just looks to me wrong that it is possible to have roster function not doing any formatting and test will pass.
Re format: I’ve removed it in my branch

Assuming track maintainers do sign off on a PR for this, you may also want to read the docs on exercise metadata. Tests are tracked in the metadata files, too. Practice Exercises | Exercism's Docs

The PR was auto closed because most tracks do not accept PRs unless the change was first discussed and approved via the forum. If you want to propose a change, we ask that you discuss the change in the forum and only send a PR if the proposal was accepted and a PR was requested.

Thanks. I imagine @ErikSchierboom, the track maintainer, will look at this next week for you :slight_smile:

Is that test even valid? The exercise requires you define an empty which creates an empty School. This test sets school to a seq of values, not a School object.

School is just a Map<int, string list>, and test creates this Map, it is valid, as I was testing it.

PR was merged