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); self::assertTrue($result->valid()); self::assertSame('hello', $result->current()); self::assertSame((int) Math\INFINITY, $result->key()); } }