summaryrefslogtreecommitdiff
path: root/src/twelve.rs
Commit message (Collapse)AuthorAge
* Switch from quickcheck to proptest.Owen Jacobson2020-06-26
| | | | | | | | | | | | | The argument is as given in the proptest docs at <https://altsysrq.github.io/proptest-book/proptest/vs-quickcheck.html>. I've found that the resulting tests are somewhat clearer, and that the tools for working with test case generation are more useful. The other killer feature is recalling test failure examples from run to run. This change includes at least one bug found while testing the port! Finally, if <https://github.com/AltSysrq/proptest/issues/179> is to be believed, proptest is considerably closer to supporting async tests.
* Disregard test strings that can be converted to numbers when testing ↵Owen Jacobson2020-06-17
| | | | | | | | non-numeric strings. This is a straight oversight in the property. We asserted the proposition "the string contains no NULs implies the string will be rejected," but the test suite found a counterexample: `"0"` contains no NULs and is not rejected. This is correct behaviour - the string "0" should be converted to the port number 0! So, now the proposition is more complex: "the string contains no NULs and cannot be converted to a number implies the string will be rejected." This closely mirrors the implementation, which isn't fantastic, but I can't see a more succinct and accurate way to frame the property.
* Fix broken doctests.Owen Jacobson2020-06-16
| | | | Rust nightly un-broke doctests!
* fmtOwen Jacobson2020-06-04
|
* Port things-to-check to Rust as a learning exercise.Owen Jacobson2020-06-03
This is somewhat overengineered in places, but does the job and exposes broadly the same interfaces as the Python version. Builds with emk/rust.