File tree 4 files changed +11
-8
lines changed
4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change
1
+ ## 5.4.6
2
+
3
+ * When formatting a generated mocks library, use the language version of the
4
+ library with the mockito annotation.
5
+
1
6
## 5.4.5
2
7
3
8
* Ignore "must_be_immutable" warning in generated files. Mocks cannot be made
Original file line number Diff line number Diff line change @@ -141,11 +141,9 @@ class MockBuilder implements Builder {
141
141
orderDirectives: true ,
142
142
useNullSafetySyntax: sourceLibIsNonNullable);
143
143
final rawOutput = mockLibrary.accept (emitter).toString ();
144
- // The source lib may be pre-null-safety because of an explicit opt-out
145
- // (`// @dart=2.9`), as opposed to living in a pre-null-safety package. To
146
- // allow for this situation, we must also add an opt-out comment here.
144
+
147
145
final mockLibraryContent =
148
- DartFormatter (languageVersion: DartFormatter .latestLanguageVersion )
146
+ DartFormatter (languageVersion: entryLib.languageVersion.effective )
149
147
.format ('''
150
148
// Mocks generated by Mockito $packageVersion from annotations
151
149
// in ${entryLib .definingCompilationUnit .source .uri .path }.
@@ -195,7 +193,7 @@ $rawOutput
195
193
interface .typeArguments.forEach (addTypesFrom);
196
194
interface .allSupertypes.forEach (addTypesFrom);
197
195
case final analyzer.RecordType record:
198
- record.positionalTypes .forEach (addTypesFrom);
196
+ record.positionalFields. map ((e) => e.type) .forEach (addTypesFrom);
199
197
record.namedFields.map ((e) => e.type).forEach (addTypesFrom);
200
198
}
201
199
}
Original file line number Diff line number Diff line change 1
- const packageVersion = '5.4.5 ' ;
1
+ const packageVersion = '5.4.6 ' ;
Original file line number Diff line number Diff line change 1
1
name : mockito
2
- version : 5.4.5
2
+ version : 5.4.6
3
3
description : >-
4
4
A mock framework inspired by Mockito with APIs for Fakes, Mocks,
5
5
behavior verification, and stubbing.
@@ -30,5 +30,5 @@ dev_dependencies:
30
30
build_web_compilers : ^4.0.11
31
31
http : ^1.0.0
32
32
lints : ^5.1.0
33
- package_config : ^2.1.0
33
+ package_config : ^2.1.1
34
34
test : ^1.24.4
You can’t perform that action at this time.
0 commit comments