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

findpkg: unit tests #62

Closed
hugelgupf opened this issue Jan 5, 2022 · 1 comment
Closed

findpkg: unit tests #62

hugelgupf opened this issue Jan 5, 2022 · 1 comment
Assignees

Comments

@hugelgupf
Copy link
Member

hugelgupf commented Jan 5, 2022

pkg/findpkg needs some good test coverage of both Go module mode and GOPATH mode look ups of packages. Cases to consider:

  • looking up directories that don't contain any Go files
  • looking up packages in Go module mode
  • looking up packages in GOPATH mode
  • looking up Go modules outside of GOPATH in GOPATH mode
  • looking up a Go package that isn't a command
  • looking up a directory that only contains Go test files, but no Go command/package
  • looking up more than one command, but one has a go.mod and the other does not, in Go module mode
  • looking up 2 or more Go commands in 2 or more Go modules (testing the batching by module)

Due to #60 we need not consider looking up non-filesystem paths.

Rec: add directories with the desired scenario of module/package/command setups to the ./test and ./vendortest directories at the root of the repo to use in the test

@hugelgupf
Copy link
Member Author

Solved by #79.

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