You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sync: write fuller description for nested test cases (#301)
Some exercises in the `problem-specifications` repo have a
`canonical-data.json` file that uses nesting, meaning that there is more
than one `cases` property.
`configlet` handled these nicely, but each `description` in each
`tests.toml` file contained only the description of the test case
itself. This could be unclear, and was especially confusing when test
cases in different nested objects had the same description. Each
`description` is purely for humans to read - it isn't used otherwise.
With this commit, `configlet sync` writes the "full description" to the
`tests.toml` file. For example, a `tests.toml` for the `triangle`
exercise might previously contain (omitting other test cases for
clarity):
```toml
[3022f537-b8e5-4cc1-8f12-fd775827a00c]
description = "sides may be floats"
[adb4ee20-532f-43dc-8d31-e9271b7ef2bc]
description = "sides may be floats"
[26d9d59d-f8f1-40d3-ad58-ae4d54123d7d]
description = "sides may be floats"
```
But with this commit:
```toml
[3022f537-b8e5-4cc1-8f12-fd775827a00c]
description = "equilateral triangle → sides may be floats"
[adb4ee20-532f-43dc-8d31-e9271b7ef2bc]
description = "isosceles triangle → sides may be floats"
[26d9d59d-f8f1-40d3-ad58-ae4d54123d7d]
description = "scalene triangle → sides may be floats"
```
For the canonical data for this exercise, see:
https://github.com/exercism/problem-specifications/blob/f17f457fdc06/exercises/triangle/canonical-data.json
We decided that putting everything in `description` is better than:
- adding extra key/value pair(s) named e.g. `category` or `super`
- adding TOML comments
- using sub-tables
While working on this PR, we noticed that 18 exercises in
`problem-specifications` had unnecessary nesting. We simplified them in
exercism/problem-specifications#1798Closes: #202
Co-authored-by: ee7 <[email protected]>
0 commit comments