public function testShrinksLinearlyTowardsTheSmallerAbsoluteValue()
{
/* Not a good shrinking policy, it should start to shrink from 0 and move
* towards the smaller absolute value.
* To be refactored next.
*/
$generator = new ChooseGenerator(-10, 200);
$value = $generator($this->size, $this->rand);
$target = 10;
$distance = abs($target - $value->unbox());
for ($i = 0; $i < 190; $i++) {
$newValue = $generator->shrink($value);
$newDistance = abs($target - $newValue->unbox());
$this->assertTrue($newDistance <= $distance, "Failed asserting that {$newDistance} is less than or equal to {$distance}");
$value = $newValue;
$distance = $newDistance;
}
$this->assertSame($target, $value->unbox());
}