Port tests to Test2 and improve coverage #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt at addressing the issues raised in #9. In particular, that to test random data it is more efficient to control the random seed than to iterate multiple times over the different paths.
As a baseline, this is what
dzil cover
reported before the changes in this branch:And after
Although test coverage was high before, the suite took ~16 seconds to run on my machine. The new test suite takes a quarter of the time, and covers a little more code.
As an added bonus, the process of checking the different branches revealed a bug in
rand_set()
which meant that, calling it in scalar context, it would return an array of references rather than an array reference.This changes use Test2::V0, but some of the tests still use Test::More. I'm not entirely sure how these tests should be ported, but this can be done separately, before the next release.