-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the compare different type rule, to allow using WithTransform
The `WithTransform` matcher can be used to transform the actual value type. This PR fix a false positive when using this matcher to change the actual value type to match the matcher type. For example: ```go Expect(uint(5)).Should(WithTransform(func(i uint) int { return int(i) }, Equal(5))) ``` In this case, the test should work because the transform function (the first parameter of the `WithTransform` matcher) casts the `uint` actual value to `int`, to match the `Equal(5)` matcher.
- Loading branch information
Showing
3 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters