alunduil / alunduil/collection-json.hs
Every decode test has one obvious group to belong to
- Lenguaje dominante
- Haskell
- Estrellas
- 3
- Forks
- 1
- Merge medio
- 5 h 32 min
- PR fusionados (30 d)
- 67
Descripción
## Summary
Reorganise the top-level groups in `Data.CollectionJSONTest` so each
decode test has one obvious home. Test-only; no assertions added or
removed.
## Motivation
Four of the nine top-level groups all cover decode acceptance and
rejection, with boundaries a reader has to reverse-engineer:
- `RFC compliance (…)` — `Template` decodes from `{}`, `Collection`
from `{"collection":{}}`
- `common parse errors` — `Collection` fails on `{}`
- `required keys` — `Link`/`Query` without `href`/`rel`, `Datum`
without `name`
- `JSON Missing Keys` → `decode minimal JSON strings` — all seven types
decode from their minimal form
`RFC compliance` and `decode minimal JSON strings` both assert that
minimal input decodes. `common parse errors` and `required keys` both
assert one rule — a spec-required key is absent, so decode fails —
where `collection` just happens to be the top-level one. Adding a
decode test today means reading all four to pick a home.
Naming is inconsistent alongside it. Some groups name a concern
(`required keys`), others a field (`href`, `'Link' render`), and
capitalisation runs from `common parse errors` to `JSON Missing Keys`.
The taxonomy predates tasty — it comes from the hspec suite #147 left
behind, and #148 carried it over verbatim on purpose. PR #274 verifies
the port by diffing the rendered test tree before against after, which
only holds while every group and test name stays still. That constraint
lifts once #274 merges.
## Scope
- Partition the decode groups by the rule each exercises, retiring the
overlap between `RFC compliance` and `decode minimal JSON strings`,
and between `common parse errors` and `required keys`.
- Settle one naming convention across all top-level groups — concern or
field, and one capitalisation.
- Leave `properties` and the encode half of `JSON Missing Keys` alone
unless the chosen partition reaches them.
## Acceptance criteria
- [ ] `cabal test` reports 50 tests. A lower count means a genuine
duplicate was found; name it in the PR.
- [ ] Each top-level group's name states what separates its contents
from every other group's.
- [ ] Group names follow one naming convention and one capitalisation.
## Additional context
Surfaced reviewing #274, which renamed the module to
`Data.CollectionJSONTest`. #147 is the audit that produced the current
group names.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.