expectException(Psl\Exception\InvariantViolationException::class); $this->expectExceptionMessage('Number of repetitions must be non-negative.'); Iter\repeat(4, -1); } public function testRepeatToInfinityIfNumIsNotProvided(): void { $result = Iter\repeat('hello'); $result->seek((int) Math\INFINITY); static::assertTrue($result->valid()); static::assertSame('hello', $result->current()); static::assertSame((int) Math\INFINITY, $result->key()); } }