Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions fixtures/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public static function directories(): Set
*/
private static function strings(): Set
{
return Set::strings()->filter(
static fn($value) => (bool) \preg_match('~\S+~', $value),
);
return Set::strings()
->filter(static fn($value) => (bool) \preg_match('~\S+~', $value))
->exclude(static fn($value) => \str_contains($value, '//'))
->exclude(static fn($value) => \str_starts_with($value, '\\'));
}
}
7 changes: 7 additions & 0 deletions tests/PathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ public function testResolveAbsolutility(): BlackBox\Proof
});
}

public function testPathStartingWithBackslashIsInvalid()
{
$this->assert()->throws(
static fn() => Path::of('\\\\'),
);
}

public static function resolutions(): array
{
return [
Expand Down
Loading