mirror of
https://github.com/flutter/packages.git
synced 2025-08-06 00:42:13 +08:00
[flutter_plugin_tools] Simplify extraFiles in test utils (#4066)
Rather than taking a list of list of path elements, just accept a list of Posix-style paths. In practice, the API was already being partially used that way.
This commit is contained in:
@ -37,10 +37,8 @@ void main() {
|
||||
|
||||
test('building for iOS when plugin is not set up for iOS results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
]);
|
||||
final Directory pluginDirectory = createFakePlugin('plugin', packagesDir,
|
||||
extraFiles: <String>['example/test']);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
@ -66,12 +64,16 @@ void main() {
|
||||
});
|
||||
|
||||
test('building for ios', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
], platformSupport: <String, PlatformSupport>{
|
||||
kPlatformIos: PlatformSupport.inline
|
||||
});
|
||||
final Directory pluginDirectory = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/test',
|
||||
],
|
||||
platformSupport: <String, PlatformSupport>{
|
||||
kPlatformIos: PlatformSupport.inline
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
@ -113,8 +115,8 @@ void main() {
|
||||
'building for Linux when plugin is not set up for Linux results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
@ -141,12 +143,16 @@ void main() {
|
||||
});
|
||||
|
||||
test('building for Linux', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
], platformSupport: <String, PlatformSupport>{
|
||||
kPlatformLinux: PlatformSupport.inline,
|
||||
});
|
||||
final Directory pluginDirectory = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/test',
|
||||
],
|
||||
platformSupport: <String, PlatformSupport>{
|
||||
kPlatformLinux: PlatformSupport.inline,
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
@ -176,8 +182,8 @@ void main() {
|
||||
test('building for macos with no implementation results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
@ -204,13 +210,17 @@ void main() {
|
||||
});
|
||||
|
||||
test('building for macos', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
<String>['example', 'macos', 'macos.swift'],
|
||||
], platformSupport: <String, PlatformSupport>{
|
||||
kPlatformMacos: PlatformSupport.inline,
|
||||
});
|
||||
final Directory pluginDirectory = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/test',
|
||||
'example/macos/macos.swift',
|
||||
],
|
||||
platformSupport: <String, PlatformSupport>{
|
||||
kPlatformMacos: PlatformSupport.inline,
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
@ -239,8 +249,8 @@ void main() {
|
||||
|
||||
test('building for web with no implementation results in no-op', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
@ -267,13 +277,17 @@ void main() {
|
||||
});
|
||||
|
||||
test('building for web', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
<String>['example', 'web', 'index.html'],
|
||||
], platformSupport: <String, PlatformSupport>{
|
||||
kPlatformWeb: PlatformSupport.inline,
|
||||
});
|
||||
final Directory pluginDirectory = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/test',
|
||||
'example/web/index.html',
|
||||
],
|
||||
platformSupport: <String, PlatformSupport>{
|
||||
kPlatformWeb: PlatformSupport.inline,
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
@ -304,8 +318,8 @@ void main() {
|
||||
'building for Windows when plugin is not set up for Windows results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
@ -332,12 +346,16 @@ void main() {
|
||||
});
|
||||
|
||||
test('building for windows', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
], platformSupport: <String, PlatformSupport>{
|
||||
kPlatformWindows: PlatformSupport.inline
|
||||
});
|
||||
final Directory pluginDirectory = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/test',
|
||||
],
|
||||
platformSupport: <String, PlatformSupport>{
|
||||
kPlatformWindows: PlatformSupport.inline
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
@ -368,8 +386,8 @@ void main() {
|
||||
'building for Android when plugin is not set up for Android results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
@ -396,12 +414,16 @@ void main() {
|
||||
});
|
||||
|
||||
test('building for android', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
], platformSupport: <String, PlatformSupport>{
|
||||
kPlatformAndroid: PlatformSupport.inline
|
||||
});
|
||||
final Directory pluginDirectory = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/test',
|
||||
],
|
||||
platformSupport: <String, PlatformSupport>{
|
||||
kPlatformAndroid: PlatformSupport.inline
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
@ -433,12 +455,16 @@ void main() {
|
||||
});
|
||||
|
||||
test('enable-experiment flag for Android', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
], platformSupport: <String, PlatformSupport>{
|
||||
kPlatformAndroid: PlatformSupport.inline
|
||||
});
|
||||
final Directory pluginDirectory = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/test',
|
||||
],
|
||||
platformSupport: <String, PlatformSupport>{
|
||||
kPlatformAndroid: PlatformSupport.inline
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
@ -462,12 +488,16 @@ void main() {
|
||||
});
|
||||
|
||||
test('enable-experiment flag for ios', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <List<String>>[
|
||||
<String>['example', 'test'],
|
||||
], platformSupport: <String, PlatformSupport>{
|
||||
kPlatformIos: PlatformSupport.inline
|
||||
});
|
||||
final Directory pluginDirectory = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/test',
|
||||
],
|
||||
platformSupport: <String, PlatformSupport>{
|
||||
kPlatformIos: PlatformSupport.inline
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
|
Reference in New Issue
Block a user