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

fixed regexp not properly escape windows backslash in path #17690

Closed
wants to merge 2 commits into from
Closed

fixed regexp not properly escape windows backslash in path #17690

wants to merge 2 commits into from

Commits on Sep 29, 2022

  1. fixed regexp not properly escape windows backslash in path

    Suddenly, my CLI stopped working when provided a file path on windows in `npx playwright test c:\foo\bar\123`.
    I tracked it down, that the cli runner forces a path to become a regex, if a string is given.
    But, for whatever reason (I don't see any relevant change here since a long time), this stopped working.
    If a path contains a backslash (so on windows), the regex never match, because a backslash need to be double escaped.
    Especially when you have number as filename in your path, it get's weird. Example: `c:\foo\bar\3rdparty` will become `c:\foo\bar\x03rdparty` in the regex, without escaping.
    
    This change fix this behaviour.
    Also this works when providing already escaped backslashes in path.
    
    Here is the regex test for it: https://regex101.com/r/W5QO7Q/2
    
    I don't see why this has ever worked before, but maybe a TS compiler change or a NodeJs change in a recent version (i am on 16.17.0 now) caused this regex to no longer work.
    brainfoolong authored Sep 29, 2022
    Configuration menu
    Copy the full SHA
    e146d72 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    71490e6 View commit details
    Browse the repository at this point in the history