mirror of
https://github.com/flutter/packages.git
synced 2025-06-20 06:08:35 +08:00
[tools] Allow skipping packages by Dart version (#6038)
This commit is contained in:
@ -340,7 +340,7 @@ void main() {
|
||||
}
|
||||
});
|
||||
|
||||
test('skips unsupported versions when requested', () async {
|
||||
test('skips unsupported Flutter versions when requested', () async {
|
||||
final RepositoryPackage excluded = createFakePlugin(
|
||||
'a_plugin', packagesDir,
|
||||
flutterConstraint: '>=2.10.0');
|
||||
@ -370,6 +370,37 @@ void main() {
|
||||
'$_startSkipColor SKIPPING: Does not support Flutter 2.5.0$_endColor',
|
||||
]));
|
||||
});
|
||||
|
||||
test('skips unsupported Dart versions when requested', () async {
|
||||
final RepositoryPackage excluded = createFakePackage(
|
||||
'excluded_package', packagesDir,
|
||||
isFlutter: false, dartConstraint: '>=2.17.0 <3.0.0');
|
||||
final RepositoryPackage included = createFakePackage(
|
||||
'a_package', packagesDir,
|
||||
isFlutter: false, dartConstraint: '>=2.14.0 <3.0.0');
|
||||
|
||||
final TestPackageLoopingCommand command = createTestCommand(
|
||||
packageLoopingType: PackageLoopingType.includeAllSubpackages,
|
||||
hasLongOutput: false);
|
||||
final List<String> output = await runCommand(command,
|
||||
arguments: <String>['--skip-if-not-supporting-dart-version=2.14.0']);
|
||||
|
||||
expect(
|
||||
command.checkedPackages,
|
||||
unorderedEquals(<String>[
|
||||
included.path,
|
||||
getExampleDir(included).path,
|
||||
]));
|
||||
expect(command.checkedPackages, isNot(contains(excluded.path)));
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<String>[
|
||||
'${_startHeadingColor}Running for a_package...$_endColor',
|
||||
'${_startHeadingColor}Running for excluded_package...$_endColor',
|
||||
'$_startSkipColor SKIPPING: Does not support Dart 2.14.0$_endColor',
|
||||
]));
|
||||
});
|
||||
});
|
||||
|
||||
group('output', () {
|
||||
|
Reference in New Issue
Block a user