Description
In x-common, we have various exercises with canonical-data.json representing the recommended set of tests for that exercise. We created generators to more easily keep up with changes in x-common. Whenever x-common changes, the task is as simple as re-running the generator.
The current documentation is at https://github.com/exercism/xgo#generating-test-cases - if at any point we find that we should explain something better, we should add any necessary documentation.
Preliminaries:
- I find the list of our generators using
ls exercises/*/cases_test.go | cut -d/ -f2
from the root of the xgo directory. - I find the list of exercises with canonical-data.json using
ls exercises/*/canonical-data.json | cut -d/ -f2
from the root of the x-common directory.
This issue concerns exercises that don't yet have a generator.
For each exercise, first we should decide whether we even want a generator.
An example where we don't want one is diamond, since property-based tests aren't represented in canonical-data.json.
So don't be afraid to suggest that we pass on having a generator if it creates more work than it saves.
After all, the point is to make maintenance of this track easy.
Or, we may decide to lazy-evaluate the generator:
If our current tests already match x-common, there is no current need to have a generator since it will make no difference currently.
So we may decide that we'll make a generator the next time the x-common JSON changes, and until then we'll stick with what we have.
If we decide we do want a generator for a given exercise:
First, we should check whether there are any cases that our track has that the common JSON doesn't have.
For each of those, we should consider the options:
- Propose adding it to the common JSON if we feel it can be valuable to other tracks
- Do nothing and just run the new generator (thus losing the extra case) if we feel the extra case does not contribute anything meaningful to this track
- Have our track's generator add the case after the JSON is parsed if we feel it adds value to the track but wouldn't add value to other tracks
- acronym ( acronym: create test case generator #691 )
- allergies ( allergies: add test generator #938 )
- all-your-base ( all-your-base: add test generator #945 )
- anagram
- atbash-cipher ( atbash-cipher: create test case generator #673 )
- beer-song
-
binaryIs deprecated in this track. - binary-search ( binary-search: add test generator #957 )
- bracket-push ( bracket-push: create test case generator #672 )
- circular-buffer Warning: Stateful test.
- collatz-conjecture ( collatz-conjecture: add generator #958 )
- crypto-square Please note crypto-square: Remove test of intermediate functions problem-specifications#750 before generating.
-
diamondUses property-based tests, so won't be generated. - difference-of-squares
- etl
- food-chain
- grains ( grains: add generator #959 )
-
hello-worldWill only ever have one test for foreseeable future, seems unnecessary to generate. - isogram (isogram: add test generator #935)
- kindergarten-garden
- minesweeper
- nth-prime ( nth-prime: add generator #964 )
- nucleotide-count
- ocr-numbers
- pangram (keep in mind More test cases #873)
- pascals-triangle
- perfect-numbers ( perfect-numbers: create test case generator #952 )
- phone-number ( Phone number add generator #664 )
- pig-latin
- poker ( poker: create test case generator #686 )
- pov
- prime-factors
- queen-attack
- react Warning: Stateful test.
- run-length-encoding ( run-length-encoding: create test case generator #948 )
- robot-simulator
- saddle-points
- say ( say: generate tests #885 )
- scrabble-score ( scrabble-score: create test case generator #665 )
- secret-handshake ( secret-handshake: create test case generator #693 )
- sieve ( sieve: add generator #962 )
- sum-of-multiples ( sum-of-multiples: create test case generator #684 )
- tournament
- triangle Warning: Would significantly change exercise behaviour, due to Triangle: Update tests to check properties, not types problem-specifications#424.
-
trinaryIs deprecated in this track. - variable-length-quantity ( variable-length-quantity: create test case generator #674 )
- word-search ( word-search: create test case generator #871 )
- wordy ( wordy: create test case generator #949 )