diff --git a/tests/Psl/Random/BytesTest.php b/tests/Psl/Random/BytesTest.php index f0a409c..31600fb 100644 --- a/tests/Psl/Random/BytesTest.php +++ b/tests/Psl/Random/BytesTest.php @@ -18,6 +18,11 @@ class BytesTest extends TestCase self::assertSame(32, Str\Byte\length($random)); } + public function testBytesEarlyReturnForZeroLength(): void + { + self::assertSame('', Random\bytes(0)); + } + public function testBytesThrowsForNegativeLength(): void { $this->expectException(Exception\InvariantViolationException::class); diff --git a/tests/Psl/Random/StringTest.php b/tests/Psl/Random/StringTest.php index df13ade..4bd4820 100644 --- a/tests/Psl/Random/StringTest.php +++ b/tests/Psl/Random/StringTest.php @@ -31,6 +31,11 @@ class StringTest extends TestCase } } + public function testStringEarlyReturnForZeroLength(): void + { + self::assertSame('', Random\string(0)); + } + public function testStringThrowsForNegativeLength(): void { $this->expectException(Exception\InvariantViolationException::class);