You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
449: Improve `tuple_windows()` doc (add a reference to `pairwise`) r=jswrenn a=robinmoussu
As shown in #388, tuple_windows can be hard to find if you come from other
environment (python, RxJs, …) since people may expect to find a `pairwise()`
method instead.
461: Clean up specializations tests r=jswrenn a=phimuemue
In response to this comment #413 (comment):
> If the contribution is an optimized specialization of an `Iterator` method (such as `nth` or `fold`), the specialization needs to be very thoroughly tested (preferably with quickcheck tests) to ensure it behaves identically (_especially_ on edge cases, and with when it panics).
I thought about having a simple way to test specializations: If we had *one* test function testing all specializations, we would have an easy way to quickcheck specializations for our iterators.
We already had quite a bit in place, so I took it and streamlined it a bit.
* `fold` is tested by remembering all elements provided to the closure (instead of only XORing elements).
* cleaned up some things (unused specialization of `size_hint`, some redundant lifetimes, superfluous arguments)
* test all specializations in one function (instead of only some specializations in two functions)
* remove manual special case tests in favor of quickcheck'd ones
If we decide to do it like this, we can, in a future commit, just do the following for all iterators (possibly via a macro) to test specializations uniformly (and hopefully reliably):
```
quickcheck! {
fn test_specializations_qc(params_for_iterator) -> () {
test_specializations(&make_iterator_to_be_tested(params_for_iterator));
}
}
```
This way, we would also test methods that are not even specialized, but for simplicity, I'd be willing to accept this. If we see that it slows things down considerably, we could still devise a simple solution that would allow to specify the methods to be tested.
Co-authored-by: Robin Moussu <[email protected]>
Co-authored-by: philipp <[email protected]>
0 commit comments