Closed piotrjoniec closed 5 months ago
The same happens to me
PHP Version 8.2.14
Operation System Linux (windows using WSL2)
Using regex like /ExampleTest/
the error does not happen to me, as the author comments.
Using a regex delimiter other than /
does throw an error in --watch
mode:
at 09:10:19 ❯ ./vendor/bin/pest --filter '#asdf#' --watch
INFO No tests found.
Pest\Exceptions\FatalException
preg_match(): Unknown modifier 'c'
at vendor/pestphp/pest/overrides/Runner/Filter/NameFilterIterator.php:104
100▕ * @throws Exception
101▕ */
102▕ private function setFilter(string $filter): void
103▕ {
➜ 104▕ if (@preg_match($filter, '') === false) {
105▕ // Handles:
106▕ // * testAssertEqualsSucceeds#4
107▕ // * testAssertEqualsSucceeds#4-8
108▕ if (preg_match('/^(.*?)#(\d+)(?:-(\d+))?$/', $filter, $matches)) {
Fixed on Pest v2.33.2
.
What Happened
I get this exception thrown when using
--filter
, even in a fresh Laravel installation. I'm using Ubuntu on WSL2.It doesn't happen if I pass a full regex such as
/asdf/
.How to Reproduce
Create a new Laravel project with Pest, then run:
Sample Repository
No response
Pest Version
2.33.0
PHP Version
8.3.1
Operation System
Linux
Notes
No response