-
-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Bug Report
| Q | A |
|---|---|
| BC Break | no |
| Library Version | 0.4.0 |
| PHP version | 7.4 |
Summary
Pattern matching with wildcards doesn't work as it should, which impacts the expressions selectors.
Current behavior
The pattern *This will match with the expression SoThisIsAnExample
public function test_wildcard_is_for_alphanumeric(): void
{
$pattern = new PatternString('SoThisIsAnExample');
$this->assertTrue($pattern->matches('*This*'));
$this->assertFalse($pattern->matches('This*')); // this passes
$this->assertFalse($pattern->matches('*This')); // this fails but it should pass because the given string doesn't end with `This`
}How to reproduce
Add this line to the test \Arkitect\Tests\Unit\Analyzer\PatternStringTest::test_wildcard_is_for_alphanumeric()
$this->assertFalse($pattern->matches('*This'));Expected behavior
The test with the extra line should pass
public function test_wildcard_is_for_alphanumeric(): void
{
$pattern = new PatternString('SoThisIsAnExample');
$this->assertTrue($pattern->matches('*This*'));
$this->assertFalse($pattern->matches('This*')); // this passes
$this->assertFalse($pattern->matches('*This')); // this should pass
}Metadata
Metadata
Assignees
Labels
No labels