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

testing: report line number for F.Add call with mismatched type #48302

Open
jayconrod opened this issue Sep 9, 2021 · 0 comments
Open

testing: report line number for F.Add call with mismatched type #48302

jayconrod opened this issue Sep 9, 2021 · 0 comments

Comments

@jayconrod
Copy link
Contributor

@jayconrod jayconrod commented Sep 9, 2021

If F.Add is called with values with types that don't match the fuzz function's parameter types, f.Fuzz reports a fatal error and exits.

func Fuzz(f *testing.F) {
  f.Add("string not bytes")
  f.Fuzz(func(t *testing.T, b []byte) { ... })
}

The error message should point to the location where F.Add was called to make the error easy to correct.

A vet check (#46218) should report errors for these calls at build time.

@jayconrod jayconrod added this to the Backlog milestone Sep 9, 2021
@rsc rsc changed the title [dev.fuzz] testing: report line number for F.Add call with mismatched type testing: report line number for F.Add call with mismatched type Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant