Refactor flutter_plugins (#145870)

Refactor flutter_plugins suite in order to reduce testing logic in test.dart and allow for later implementing package:test onto the existing flutter_plugins tests

Also update the test_test invocation of getFlutterPackagesVersion

Part of https://github.com/flutter/flutter/issues/145482
This commit is contained in:
Jesse
2024-03-28 20:59:30 -04:00
committed by GitHub
parent 0984a7f04b
commit 93b071e727
3 changed files with 106 additions and 88 deletions

View File

@@ -9,6 +9,7 @@ import 'package:file/memory.dart';
import 'package:path/path.dart' as path;
import 'package:process/process.dart';
import '../suite_runners/run_flutter_packages_tests.dart';
import '../test.dart';
import 'common.dart';
@@ -92,13 +93,13 @@ void main() {
test('commit hash', () async {
packagesVersionFile.writeAsStringSync(kSampleHash);
final String actualHash = await getFlutterPackagesVersion(fileSystem: memoryFileSystem, packagesVersionFile: packagesVersionFile.path);
final String actualHash = await getFlutterPackagesVersion(flutterRoot: flutterRoot, fileSystem: memoryFileSystem, packagesVersionFile: packagesVersionFile.path);
expect(actualHash, kSampleHash);
});
test('commit hash with newlines', () async {
packagesVersionFile.writeAsStringSync('\n$kSampleHash\n');
final String actualHash = await getFlutterPackagesVersion(fileSystem: memoryFileSystem, packagesVersionFile: packagesVersionFile.path);
final String actualHash = await getFlutterPackagesVersion(flutterRoot: flutterRoot, fileSystem: memoryFileSystem, packagesVersionFile: packagesVersionFile.path);
expect(actualHash, kSampleHash);
});
});