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

TestWire/UnexportedStruct fails because of the error wording #412

Open
dmitris opened this issue Sep 2, 2024 · 0 comments · May be fixed by #413
Open

TestWire/UnexportedStruct fails because of the error wording #412

dmitris opened this issue Sep 2, 2024 · 0 comments · May be fixed by #413

Comments

@dmitris
Copy link
Contributor

dmitris commented Sep 2, 2024

Describe the bug

go test ./... fails with go1.23.0 and go1.22.6 due to a minor change in the error wording:

$ go test ./...
?   	github.com/google/wire	[no test files]
?   	github.com/google/wire/cmd/wire	[no test files]
--- FAIL: TestWire (0.02s)
    --- FAIL: TestWire/UnexportedStruct (1.66s)
        wire_test.go:108: /private/var/folders/k5/p407cqn15lv4np6p1jt_49q00000gq/T/wire_test1432212345/src/example.com/foo/wire.go:26:17: name foo not exported by package bar
        wire_test.go:121: Errors didn't match expected errors from wire_errors.txt:
            {[]string}[0]:
            	-: "example.com/foo/wire.go:x:y: name foo not exported by package bar"
            	+: "example.com/foo/wire.go:x:y: foo not exported by package bar"
FAIL
FAIL	github.com/google/wire/internal/wire	10.686s
FAIL

To Reproduce

Run go test ./... with go1.22.6 or go1.23.0 (didn't try other versions yet)

Expected behavior

tests pass without error

A clear and concise description of what you expected to happen.
TestWire/UnexportedStruct fails:

$ go test ./...
?   	github.com/google/wire	[no test files]
?   	github.com/google/wire/cmd/wire	[no test files]
--- FAIL: TestWire (0.02s)
    --- FAIL: TestWire/UnexportedStruct (1.66s)
        wire_test.go:108: /private/var/folders/k5/p407cqn15lv4np6p1jt_49q00000gq/T/wire_test1432212345/src/example.com/foo/wire.go:26:17: name foo not exported by package bar
        wire_test.go:121: Errors didn't match expected errors from wire_errors.txt:
            {[]string}[0]:
            	-: "example.com/foo/wire.go:x:y: name foo not exported by package bar"
            	+: "example.com/foo/wire.go:x:y: foo not exported by package bar"
FAIL
FAIL	github.com/google/wire/internal/wire	10.686s
FAIL

Version

Which version of Wire are you seeing the bug with?
the latest trunk (main branch) - commit e57deea)

Additional context

A simple change of the error text in https://github.com/google/wire/blob/main/internal/wire/testdata/UnexportedStruct/want/wire_errs.txt#L1 fixes the test error, I will raise a PR to fix this.

dmitris added a commit to dmitris/wire that referenced this issue Sep 2, 2024
Change text of the expected error to fix the current
test failer of TestWire/UnexportedStruct.

Fix google#412.

Signed-off-by: Dmitry S <[email protected]>
dmitris added a commit to dmitris/wire that referenced this issue Sep 2, 2024
Change text of the expected error to fix the current
test failer of TestWire/UnexportedStruct.

Fixes google#412.

Signed-off-by: Dmitry S <[email protected]>
dmitris added a commit to dmitris/wire that referenced this issue Sep 2, 2024
Change text of the expected error to fix the current
test failure of TestWire/UnexportedStruct.

Fixes google#412.

Signed-off-by: Dmitry S <[email protected]>
@dmitris dmitris linked a pull request Sep 2, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant