@@ -76,29 +76,32 @@ void main() async {
76
76
});
77
77
});
78
78
79
- test ('runPackageName' , () async {
80
- await inTempDir ((tempUri) async {
81
- await copyTestProjects (targetUri: tempUri);
82
- final nativeAddUri = tempUri.resolve ('native_add/' );
79
+ for (final existing in [true , false ]) {
80
+ final runPackageName = existing ? 'ffigen' : 'does_not_exist' ;
81
+ test ('runPackageName $runPackageName ' , () async {
82
+ await inTempDir ((tempUri) async {
83
+ await copyTestProjects (targetUri: tempUri);
84
+ final nativeAddUri = tempUri.resolve ('native_add/' );
83
85
84
- // First, run `pub get`, we need pub to resolve our dependencies.
85
- await runPubGet (workingDirectory: nativeAddUri, logger: logger);
86
+ // First, run `pub get`, we need pub to resolve our dependencies.
87
+ await runPubGet (workingDirectory: nativeAddUri, logger: logger);
86
88
87
- final packageLayout =
88
- await PackageLayout .fromRootPackageRoot (nativeAddUri);
89
- final packagesWithNativeAssets =
90
- await packageLayout.packagesWithNativeAssets;
91
- final nativeAssetsBuildPlanner =
92
- await NativeAssetsBuildPlanner .fromRootPackageRoot (
93
- rootPackageRoot: nativeAddUri,
94
- packagesWithNativeAssets: packagesWithNativeAssets,
95
- dartExecutable: Uri .file (Platform .resolvedExecutable),
96
- logger: logger,
97
- );
98
- final (buildPlan, _) = nativeAssetsBuildPlanner.plan (
99
- runPackageName: 'ffigen' ,
100
- );
101
- expect (buildPlan.length, 0 );
89
+ final packageLayout =
90
+ await PackageLayout .fromRootPackageRoot (nativeAddUri);
91
+ final packagesWithNativeAssets =
92
+ await packageLayout.packagesWithNativeAssets;
93
+ final nativeAssetsBuildPlanner =
94
+ await NativeAssetsBuildPlanner .fromRootPackageRoot (
95
+ rootPackageRoot: nativeAddUri,
96
+ packagesWithNativeAssets: packagesWithNativeAssets,
97
+ dartExecutable: Uri .file (Platform .resolvedExecutable),
98
+ logger: logger,
99
+ );
100
+ final (buildPlan, _) = nativeAssetsBuildPlanner.plan (
101
+ runPackageName: runPackageName,
102
+ );
103
+ expect (buildPlan.length, 0 );
104
+ });
102
105
});
103
- });
106
+ }
104
107
}
0 commit comments