Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert::match does not match valid regex #350

Open
PunchyRascal opened this issue Feb 7, 2017 · 2 comments
Open

Assert::match does not match valid regex #350

PunchyRascal opened this issue Feb 7, 2017 · 2 comments

Comments

@PunchyRascal
Copy link

PunchyRascal commented Feb 7, 2017

  • bug report? yes/no
  • feature request? yes/no
  • version: v1.7.1

Description

Until you realize, that your regex pattern cannot be delimited with /, the function does not work properly.

Steps To Reproduce

fails: Assert::match('/^foo$/', 'foo');
passes: Assert::match('#^foo$#', 'foo');

Perhaps it would be better to avoid this magic behavior (there is no indication you have done anything wrong) and add an extra assert for those tester expressions (with appropriate name) and keep this only for regular expressions, to avoid confusion. Or vice versa.

@milo
Copy link
Member

milo commented Aug 13, 2017

Maybe add Assert::matchRE() and Assert::outputMatchRE()?

@PunchyRascal
Copy link
Author

Yeah, sure.

Sorry for the delay, I am now browsing through all my open issues, must have missed it back then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants