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

TestKeepWorkDir fails on Windows #104

Open
rillig opened this issue Aug 29, 2018 · 1 comment
Open

TestKeepWorkDir fails on Windows #104

rillig opened this issue Aug 29, 2018 · 1 comment

Comments

@rillig
Copy link

rillig commented Aug 29, 2018

To reproduce:

cmd /c ver

Microsoft Windows [Version 10.0.17134.228]

git co 788fd78401277ebd861206a03c884797c6ec5541

go test

Output:

FAIL: run_test.go:409: RunS.TestKeepWorkDir

run_test.go:414:
    c.Assert(result.String(), Matches, ".*\nWORK="+result.WorkDir)
... value string = "" +
...     "OK: 1 passed\n" +
...     "WORK=C:\\Users\\rillig\\Program Files\\cygwin\\tmp\\check-8674665223082153551"
... regex string = "" +
...     ".*\n" +
...     "WORK=C:\\Users\\rillig\\Program Files\\cygwin\\tmp\\check-8674665223082153551"
... Can't compile regex: error parsing regexp: invalid escape sequence: `\U`

Either result.WorkDir should be properly escaped, or the temporary directory should be replaced with a placeholder before the comparison. I did the latter variant in pkglint, search for func (t *Tester) Output() string.

@jhenstridge
Copy link
Contributor

This looks to be fixed by 10cb982 (which updates the CI to run the test suite on Windows), which quotes WorkDir using regexp.QuoteMeta to make it safe to include in the regular expression.

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

No branches or pull requests

2 participants