We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've discovered that mockigo cannot handle methods or functions with variadict as arguments. I have a repository with code that demonstrates the bug:
https://github.com/shackra/mockigo-variadic-bug
if you run just run, you'll see that the example works as expected:
just run
$ just run go build -o mockigo-variadic-bug ./mockigo-variadic-bug adding numbers for hello world... hello world is 11
With just test you can run the tests.
just test
However, in tests, we don't have any way to set an argument for a variadict argument, we have to use match.Any instead.
match.Any
mock.EXPECT(). Sum(match.AnyCtx(), match.Eq("test"), match.Any[int]()). // <- unable to use match.Arg[[]int] Return(18)
if we want to leave that argument empty, we get a different error:
$ just test go test -covermode=count -coverprofile coverage ./... --- FAIL: TestCalculator (0.00s) library.go:17: Unexpected call of method "Sum" because: expected call /tmp/example/library_test.go:15 expects 2 arguments, got 3 FAIL github.com/shackra/mockigo-variadic-bug coverage: 30.0% of statements FAIL github.com/shackra/mockigo-variadic-bug 0.002s FAIL error: Recipe `test` failed on line 2 with exit code 1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've discovered that mockigo cannot handle methods or functions with variadict as arguments. I have a repository with code that demonstrates the bug:
https://github.com/shackra/mockigo-variadic-bug
if you run
just run
, you'll see that the example works as expected:With
just test
you can run the tests.However, in tests, we don't have any way to set an argument for a variadict argument, we have to use
match.Any
instead.if we want to leave that argument empty, we get a different error:
The text was updated successfully, but these errors were encountered: