exercism / sml

Exercism exercises in Standard ML.
https://exercism.org/tracks/sml
MIT License
26 stars 33 forks source link

Improve and distribute epsilon-delta test function across exercises #110

Open sshine opened 5 years ago

sshine commented 5 years ago

Before 4c5fd1db1ae73d2bef7d9d12256a59d5fc4597a5, no tests used Expect.nearTo. Since the canonical test data expresses expected values with some unknown imprecision (e.g. 31.69 when the result is 31.68808781), it is up to the language track to make test cases succeed correctly and meaningfully.

Since Standard ML has no standard test framework, we distribute a testlib.sml along with each exercise. The OCaml track uses OUnit2's cmp_float which I've adapted in testlib.sml for the space-age exercise.

This task consists of three parts. Feel free to pick any of these.

Evaluation

Distribution

Assertion

guygastineau commented 2 years ago

Oh, hah, I found this discrepancy in the tests from my other work on #206 and #205. I guess I have done everything except for the final step. Maybe I should add a script and CI action to verify the checksums of all testlib.sml files to #206 in order to satisfy this issue entirely.

guygastineau commented 2 years ago

@sshine Do you think our current implementation of nearTo is good enough, or should we use the full example you posted in the linked post? I don't really care enough to scrutinize their differences too much. FWIW, nearTo as it is in the testlib.sml for space age is immediately obvious.