expectException(InvariantViolationException::class); $this->expectExceptionMessage('The number of times you want to reproduct must be at least 1.'); Iter\reproduce(Fun\identity(), 0); } public function testReproduceToInfinityIfNumIsNotProvided(): void { $result = Iter\reproduce(static fn () => 'hello'); $result->seek((int) Math\INFINITY); static::assertTrue($result->valid()); static::assertSame('hello', $result->current()); static::assertSame((int) Math\INFINITY, $result->key()); } }