Fix builder tests for pub.
* Update references in test/all.dart.
* Correct references to GenerateMock, a previous design.
* Update analyzer to 0.39.15, which also thinks the language version is 2.10.
* Downgrade source_gen version to 0.9.6; 0.9.7 doesn't exist yet.
PiperOrigin-RevId: 323455052
diff --git a/test/builder/auto_mocks_test.dart b/test/builder/auto_mocks_test.dart
index bfcde9f..0a6d762 100644
--- a/test/builder/auto_mocks_test.dart
+++ b/test/builder/auto_mocks_test.dart
@@ -2045,7 +2045,7 @@
var packageConfig = PackageConfig([
Package('foo', Uri.file('/foo/'),
packageUriRoot: Uri.file('/foo/lib/'),
- languageVersion: LanguageVersion(2, 10))
+ languageVersion: LanguageVersion(2, 9))
]);
await withEnabledExperiments(
() async => await testBuilder(buildMocks(BuilderOptions({})), sourceAssets,
@@ -2063,7 +2063,7 @@
var packageConfig = PackageConfig([
Package('foo', Uri.file('/foo/'),
packageUriRoot: Uri.file('/foo/lib/'),
- languageVersion: LanguageVersion(2, 10))
+ languageVersion: LanguageVersion(2, 9))
]);
await withEnabledExperiments(
@@ -2091,7 +2091,7 @@
var packageConfig = PackageConfig([
Package('foo', Uri.file('/foo/'),
packageUriRoot: Uri.file('/foo/lib/'),
- languageVersion: LanguageVersion(2, 10))
+ languageVersion: LanguageVersion(2, 9))
]);
expect(
diff --git a/test/builder/custom_mocks_test.dart b/test/builder/custom_mocks_test.dart
index 01b7c2e..77a34ee 100644
--- a/test/builder/custom_mocks_test.dart
+++ b/test/builder/custom_mocks_test.dart
@@ -270,7 +270,7 @@
});
test(
- 'throws when GenerateMock is given a class with a type parameter with a '
+ 'throws when GenerateMocks is given a class with a type parameter with a '
'private bound', () async {
_expectBuilderThrows(
assets: {
@@ -294,14 +294,13 @@
);
});
- test("throws when GenerateMock's Of argument is missing a type argument",
- () async {
+ test('throws when MockSpec() is missing a type argument', () async {
_expectBuilderThrows(
assets: {
...annotationsAsset,
'foo|test/foo_test.dart': dedent('''
import 'package:mockito/annotations.dart';
- // Missing required type argument to GenerateMock.
+ // Missing required type argument to MockSpec.
@GenerateMocks([], customMocks: [MockSpec()])
void main() {}
'''),
@@ -310,7 +309,7 @@
);
});
- test('throws when GenerateMock is given a private class', () async {
+ test('throws when MockSpec uses a private class', () async {
_expectBuilderThrows(
assets: {
...annotationsAsset,
@@ -395,7 +394,7 @@
);
});
- test('throws when GenerateMock references a typedef', () async {
+ test('throws when MockSpec references a typedef', () async {
_expectBuilderThrows(
assets: {
...annotationsAsset,
@@ -408,7 +407,7 @@
);
});
- test('throws when GenerateMock references an enum', () async {
+ test('throws when MockSpec references an enum', () async {
_expectBuilderThrows(
assets: {
...annotationsAsset,
@@ -421,7 +420,7 @@
);
});
- test('throws when GenerateMock references a non-subtypeable type', () async {
+ test('throws when MockSpec references a non-subtypeable type', () async {
_expectBuilderThrows(
assets: {
...annotationsAsset,
@@ -500,7 +499,7 @@
var packageConfig = PackageConfig([
Package('foo', Uri.file('/foo/'),
packageUriRoot: Uri.file('/foo/lib/'),
- languageVersion: LanguageVersion(2, 10))
+ languageVersion: LanguageVersion(2, 9))
]);
await withEnabledExperiments(