ohbarye / pbt

Property-Based Testing tool for Ruby, supporting multiple concurrency methods (Ractor, multiprocesses, multithreads).
https://rubygems.org/gems/pbt
MIT License
207 stars 4 forks source link

More sophisticated array shrink algorithm #15

Closed ohbarye closed 6 months ago

ohbarye commented 6 months ago

Change

This pull request polishes Array's shrink algorithm so that it can cover more cases.

I didn't choose a strategy to produce all combinations of items because it could be too large and takes so long time to get done. Instead, I chose a strategy to shrink each item of an array to reduce cases.

I referred https://github.com/dubzzz/fast-check/blob/9711e54a99784ee9acd321d675ceea558825e442/packages/fast-check/src/arbitrary/_internals/ArrayArbitrary.ts#L259-L325.