Closed cessen closed 6 years ago
I have some ideas other that plain old assert!
-based tests which can also increase test coverage:
Since Rope
is a data structure, quickcheck
would be useful to automate testing the implementation against the specification. However, plain unit-tests shouldn't be discarded as useless even in this case, because they can act as regression tests (especially for corner cases).
There is also cargo-fuzz
which works like quickcheck
but on the global scale and needs much more time to work, so in practice this fact rules out most CIs and cargo-fuzz
can only be used locally.
Thanks for the suggestion! That's a great idea. After I've finished the test coverage, I'll see about adding quickcheck as well.
The public API is now completely covered by unit tests. (Unless I missed something by accident...)
I also added QuickCheck tests for the more complex and easy-to-go-wrong methods.
So I think I'll call this issue resolved. I'll work on filling in unit tests for internal bits incrementally.
There are already quite a few unit tests in Ropey, but it doesn't have complete coverage yet.
The most important thing is complete coverage of all public-facing API's, making sure they work as expected. Then unit tests of internal bits can follow.
This will be really useful when further optimizing Ropey, to make sure optimizations don't break anything.