I poked at the test generator and found some issues that I can patch if maintainers are interested.
dart bin/create_exercise.dart --spec-path ../exercism-problem-specifications prism crashed while parsing the canonical data. I saw a couple of issues.
The script tries to cast the Map<String, dynamic> for the decoded JSON to Map<String, Object>, but that fails because dynamic isn’t a subtype of Object.
-
_getFriendlyType as String Function(dynamic)fails withtype '(Object) => String' is not a subtype of type '(dynamic) => String' in type cast. -
configlet generateis used, but we should use the modernconfiglet syncto pull documents. Ideally we’d useconfiglet createif we’re creating a new exercise instead of updating an exercise. -
The script pushes the exercise files into
exercises/<slug>instead ofexercises/practice/<slug>which is the modern location for practice exercises.
Some other things.
The tests are pulled from the canonical data, but when updating an existing exercise, it’d be useful for the generator to ignore any tests marked as not included in the toml.
Example files get stored in an exercise’s lib folder alongside the stub instead of in .meta/lib.
Some pubspec.yaml files target an older sdk version like in Bottle Song which targets >=2.18.0 <3.0.0, but the root pubspec.yaml targets ‘>=3.2.0 <4.0.0’.
The generated test suites would type variables explicitly like final String result = bob.response("WHAT'S GOING ON?"); where a lot of the implemented test suites were doing final result = bob.response("WHAT'S GOING ON?");
In some test suites, the instance of the exercise class is created outside the main() function, sometimes inside it. We should create it inside every time.
Finally, we should probably run the Dart fomatter on the test generator script if we haven’t done that yet.