-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate valid functions with optional non-nullable arguments
If a method of a mocked class returns a function with optional yet non-nullable argument, Mockito currently produces something like ```dart (int x, {int y}) => /* doesn't matter */ ``` which is not a valid Dart, since `y` must either be `required` or have a default value. `required` won't fit into the desired type and coming up with a default value is not easy, since it has to be a constant, but `dummyValue` doesn't always produce one. Fortunately, we can just widen the type here and make it nullable. PiperOrigin-RevId: 582669927
- Loading branch information
1 parent
fcb9779
commit dc3eb65
Showing
4 changed files
with
24 additions
and
4 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
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