a-range icon indicating copy to clipboard operation
a-range copied to clipboard

Add doc tests to Panic documentation

Open killercup opened this issue 7 years ago • 3 comments

We recently added these docs:

https://github.com/killercup/a-range/blob/ce391ed856e5fb52e9445496ccec046b91359ed5/src/lib.rs#L54-L58

This behavior is tested in this unit test:

https://github.com/killercup/a-range/blob/ce391ed856e5fb52e9445496ccec046b91359ed5/src/lib.rs#L393-L397

It is also possible for this to become a doc test (as I've just found out), which would make this more visible.

  • [ ] Turn fail_up_to_invalid_range and fail_down_to_invalid_range tests into doc tests

killercup avatar Oct 19 '18 11:10 killercup

cc @babhishek21 -- just found out that should_panic is also available on doc tests :)

killercup avatar Oct 19 '18 11:10 killercup

Ok. On it. ✌️

babhishek21 avatar Oct 19 '18 19:10 babhishek21

Hey @killercup , do you think it makes sense to keep the original tests after putting in the doc tests?

babhishek21 avatar Mar 13 '19 19:03 babhishek21