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

interp: randomize not found name in tests #738

Closed
creack opened this issue Oct 2, 2021 · 1 comment · Fixed by #821
Closed

interp: randomize not found name in tests #738

creack opened this issue Oct 2, 2021 · 1 comment · Fixed by #821

Comments

@creack
Copy link

creack commented Oct 2, 2021

Very nit-picky, I just happened to have a binary called foo in my path, causing the tests to fail. It might be a good idea to randomize the name when checking for something not found or to use a more lengthy, unlikely-to-be-used name.

--- FAIL: TestRunnerRun (0.28s)
    --- FAIL: TestRunnerRun/#641 (0.01s)
        interp_test.go:2981: wrong output in "alias foo='bar baz'\ntype foo":
            want: "type: foo: not found\nexit status 1"
            got:  "foo is /home/creack/go/bin/foo\n"
@mvdan
Copy link
Owner

mvdan commented Oct 2, 2021

Oops, thanks for catching this :)

mvdan pushed a commit that referenced this issue Mar 18, 2022
This will avoid potential name collisions with existing "foo" or "bar"
names in $PATH or the current environment.

While here, update the README, as we now require Go 1.17 or later.

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

Successfully merging a pull request may close this issue.

2 participants