-
-
Notifications
You must be signed in to change notification settings - Fork 56
Feat: Add D&D Character exercise #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We don't really mutate state. Fixes the type mismatching issue between example.ml and the exercise's provided .mli file.
The tests were implemented by hand following the specification. The rest of automatic files via configlet because of the make commands not generating the exercises/ subdirectory
@kahgoh could you take a look at this please : ) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a glance, this generally looks ok and there are some minor comments below. However, the OCaml track also uses a test generator to generate the tests from the problem specifications. Would you like to try creating one for D&D character?
Co-authored-by: Kah Goh <[email protected]>
Co-authored-by: Kah Goh <[email protected]>
The thing is that I initially tried to generate them from a .tpl file but it's a little bit tricky for this exercise, something like the following example will never reach the
After looking into it a bit more last night I found that it might be possible to preprocess the JSON before the test generator passes it to mustache to avoid those types of errors. Can you confirm that's what it's used for? |
Yes, that's right! You can use the special cases to pre-process the JSON as needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes from your last set of commits look good. Just waiting to see how you go with the test template.
Thanks for being active ! I didn't really have time to keep you updated 😅. I've been investigating further and I think there's no way to just generate all the tests correctly via the generator in the current state of the files, unless:
This is because the errors happen in the case-sanitizing step, so before the contents can reach the So, long story short : the issue here is caused by the incompatibility between the inconsistent spec's JSON, and the way the OCaml test generator handles it (not really its fault since it is made to handle consistent JSON's), which prevents those For other exercises, even if they have multiple levels of indentation / multiple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think we can still go ahead for now. Thanks for looking into the test template!
Hi :) ! Here's a port of the D&D character practice exercise (currently not implemented in the OCaml track). Let me know if there's something missing ; )