-
Notifications
You must be signed in to change notification settings - Fork 605
ctrl.Finish() is not called in 1.14+ #447
Comments
Thanks for the report I will take a look. |
I was about to report this bug. I did a bit of digging and turns out #422 is merged on master, but is not part of any release, therefore getting the latest as the Readme suggests ( Getting it from master, IMHO the readme should match the latest release, which would avoid people being mislead. And then get a release including #422 and update the readme again. |
Thank you @AndersonQ for pointing that out, appreciated. |
I agree, I will update the readme soon. In the meantime please use |
@codyoss do you need any help? I'm happy to help :) I'll take the risk and keep with either master and keep an eye to see if I spot any bug :) |
Releasing a new version of the library and documenting that version X or newer is required will probably help to avoid the confusion. |
Apologies for commenting on this closed issue. What I am describing is surely categorized as user error, but I suspect it could be impacting others so I wanted to describe my experience. On a previous project I came to rely on Would it be possible to create a new release that includes some of the recent changes? Full disclosure, the projects I'm working on are still using |
It is stated that if go version is 1.14+ and
*t.Testing
is passed into the controller it is not needed to callctrl.Finish()
.Actual behavior
Although I'm using
1.14.3
,ctrl.Finish()
is not called when, consideringTimes(x)
,x
is greater than the actual number calls and results in a successful test. This is not the case whenx
is smaller than the number of calls made then it throws the following error as expected;expected call at ..._test.go:XX has already been called the max number of times
Expected behavior
When
Times(x)
is used to track number of calls andx
is not equal to the number of calls, tests should fail.To Reproduce
1- Use
GO 1.14.3
2- Call a method
3
times in your actual code3- Do not call
ctrl.Finish()
in your test4- Test the following cases;
Times(1)
in your test, it fails. (As expected)Times(3)
in your test, it passes. (As expected)Times(172863)
in your test, it passes. (Not expected)Additional Information
Example
main.go
main_test.go
The text was updated successfully, but these errors were encountered: