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

Matchers are not generated for Variadic Arguments #90

Closed
jpopadak opened this issue Jun 18, 2019 · 7 comments
Closed

Matchers are not generated for Variadic Arguments #90

jpopadak opened this issue Jun 18, 2019 · 7 comments
Labels

Comments

@jpopadak
Copy link
Contributor

Generating mocks for an Interface which has Variadic functions does not create matchers for the variadic arguments.

Test File

//go:generate -m github.com/org/project/package/name Asdf

Source File

package name

type Structure struct{}
type Asdf interface {
	Function(values ...Structure)
}
@petergtz
Copy link
Owner

@jpopadak True. The variadic args do give you a hard time these days :-/. Thanks for reporting it. It's a bug. It looks pretty straight forward, so I'll see if I can fix it soon.

@petergtz
Copy link
Owner

@jpopadak Can you please try with the latest on develop? If that solves your issue, I will merge it to master and make a new release.

@petergtz
Copy link
Owner

petergtz commented Jul 5, 2019

@jpopadak Did you get a chance to check this?

@jpopadak
Copy link
Contributor Author

I will try it out again sometime this week. Sorry about that.

@jpopadak
Copy link
Contributor Author

So matchers are being generated for it now 🎉

However, they are not being used to match calls for variadic arguments. I would consider that another / different bug though.

@petergtz
Copy link
Owner

@jpopadak could you be more specific? Basically provide a use case where is doesn't work for you?

The current expected behavior is that you need to provide as many matchers as you expect parameters to be passed to your mock. Only then will it match that call.

@petergtz
Copy link
Owner

@jpopadak I'm going to close this issue as per your comment above. However, could open a new issue for what you called a "different bug" above. Thank you.

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

No branches or pull requests

2 participants