JasonBock / SpackleNet

Spackle is a project that contains a number of helper methods I've used to supplement the core classes in .NET.
MIT License
14 stars 1 forks source link

Ensure That NumberOfRanges in Partition() Is At Least the Size of the Difference of the Given Range #27

Closed JasonBock closed 4 years ago

JasonBock commented 4 years ago

This:

(1..5).Partition(7)

doesn't error, but it gives non-sensical results. It would have to be:

(1..8).Partition(7)

or

(1..5).Partition(4)

to work. There's no check in the code for this, so add it.