serde-this-or-that icon indicating copy to clipboard operation
serde-this-or-that copied to clipboard

Add unit (and doc) tests for `de_impl_opt.rs`

Open rnag opened this issue 2 years ago • 2 comments

There seems to be some differing assumptions on what should be None and what shouldn't.

I find the examples section hard to read. Rather than having many examples, it may be better to have unit tests - and examples (doc tests) in src/de_impl_opt.rs doc strings.

Somewhere there should be a dense table/section where the behaviour can be seen at a glance - possibly in the doc string itself. I like the # Returns section, explaining behaviour, but this could be complemented with more comprehensive cases for each of the input types str, i64, f64, u64.

Originally posted by @corneliusroemer in https://github.com/rnag/serde-this-or-that/pull/5#pullrequestreview-1347066880

rnag avatar Mar 20 '23 18:03 rnag

Actually I did add tests for this. So I'm closing it out.

rnag avatar Jan 25 '25 05:01 rnag

Re-reading this issue description a bit more closely, and it seems adding unit tests in each module (though this was accomplished) is not enough to satisfy the ask. Re-opening this issue as a result.

rnag avatar Jan 26 '25 01:01 rnag