tool: replace top-level functions with enum properties (#126167)

This commit is contained in:
Kevin Moore
2023-05-05 12:10:07 -07:00
committed by GitHub
parent 201f7311f7
commit f9d455134a
20 changed files with 130 additions and 151 deletions

View File

@@ -56,8 +56,7 @@ void main() {
TargetPlatform.android_x64,
]) {
testWithoutContext('AndroidDevice.startApp allows release builds on $targetPlatform', () async {
final String arch = getNameForAndroidArch(
getAndroidArchForName(getNameForTargetPlatform(targetPlatform)));
final String arch = getAndroidArchForName(getNameForTargetPlatform(targetPlatform)).archName;
final AndroidDevice device = AndroidDevice('1234', modelID: 'TestModel',
fileSystem: fileSystem,
processManager: processManager,

View File

@@ -83,15 +83,15 @@ void main() {
});
testWithoutContext('getDartNameForDarwinArch returns name used in Dart SDK', () {
expect(getDartNameForDarwinArch(DarwinArch.armv7), 'armv7');
expect(getDartNameForDarwinArch(DarwinArch.arm64), 'arm64');
expect(getDartNameForDarwinArch(DarwinArch.x86_64), 'x64');
expect(DarwinArch.armv7.dartName, 'armv7');
expect(DarwinArch.arm64.dartName, 'arm64');
expect(DarwinArch.x86_64.dartName, 'x64');
});
testWithoutContext('getNameForDarwinArch returns Apple names', () {
expect(getNameForDarwinArch(DarwinArch.armv7), 'armv7');
expect(getNameForDarwinArch(DarwinArch.arm64), 'arm64');
expect(getNameForDarwinArch(DarwinArch.x86_64), 'x86_64');
expect(DarwinArch.armv7.name, 'armv7');
expect(DarwinArch.arm64.name, 'arm64');
expect(DarwinArch.x86_64.name, 'x86_64');
});
testWithoutContext('getNameForTargetPlatform on Darwin arches', () {