expectException(Psl\Exception\InvariantViolationException::class); $this->expectExceptionMessage('Start offset must be non-negative.'); Iter\slice([1, 2, 3], -3); } public function testSliceThrowsIfLengthIsNegative(): void { $this->expectException(Psl\Exception\InvariantViolationException::class); $this->expectExceptionMessage('Length must be non-negative.'); Iter\slice([1, 2, 3], 1, -3); } }