Skip to content

Fix variadic parameter handling in .EXPECT().Run() #1027

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

Merged

Conversation

LandonTClipp
Copy link
Collaborator

An issue was reported where the .Run() method of testify mocks was not handling variadic parameters correctly when unroll-variadic: False. It was attempting to grab the variadic parameters one by one by iterating through the argument list, when instead it should have just grabbed the last argument and type asserted it as a slice of the variadic type.

Fixes #1024

An issue was reported where the `.Run()` method of testify mocks
was not handling variadic parameters correctly when `unroll-variadic: False`.
It was attempting to grab the variadic parameters one by one by iterating
through the argument list, when instead it should have just grabbed the
last argument and type asserted it as a slice of the variadic type.

Fixes vektra#1024
@LandonTClipp LandonTClipp merged commit 2e4c556 into vektra:v3 Apr 23, 2025
4 checks passed
@LandonTClipp LandonTClipp deleted the LandonTClipp/variadic_run_issue_2 branch April 23, 2025 04:02
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 this pull request may close these issues.

v3 Generate Run() function doesn't handle variadic arguments correctly
1 participant