expect(fn () => PathSegmentType::Raw->routeMatchRegex()) ->toBeNull(); it('has no routeMatchRegex for Root') ->expect(fn () => PathSegmentType::Root->routeMatchRegex()) ->toBeNull(); it('has routeMatchRegex for Parameter') ->expect(fn () => PathSegmentType::Parameter->routeMatchRegex()) ->toBeString(); it('matches from route string :dataset', function (string $v, PathSegmentType $type) { $match = PathSegmentType::matchRouteString($v); expect($match->type)->toBe($type); })->with([ $v = '{test-test}' => [$v, PathSegmentType::Parameter], $v = '{test_test}' => [$v, PathSegmentType::Parameter], $v = '{testTest}' => [$v, PathSegmentType::Parameter], $v = '{TestTest}' => [$v, PathSegmentType::Parameter], $v = '{testTest912}' => [$v, PathSegmentType::Parameter], $v = 'hello-hello' => [$v, PathSegmentType::Raw], $v = 'hellohello123' => [$v, PathSegmentType::Raw], $v = 'hello_hello' => [$v, PathSegmentType::Raw], ]);