@@ -170,6 +170,61 @@ void main() {
170170 );
171171 });
172172
173+ testWithoutContext ('works if local engine is simulator' , () async {
174+ final FileSystem fileSystem = MemoryFileSystem .test ();
175+ final Directory localEngine = fileSystem
176+ .directory ('$kArbitraryEngineRoot /src/out/ios_debug_sim/' )
177+ ..createSync (recursive: true );
178+ fileSystem
179+ .directory ('$kArbitraryEngineRoot /src/out/host_debug/' )
180+ .createSync (recursive: true );
181+
182+ final BufferLogger logger = BufferLogger .test ();
183+ final LocalEngineLocator localEngineLocator = LocalEngineLocator (
184+ fileSystem: fileSystem,
185+ flutterRoot: 'flutter/flutter' ,
186+ logger: logger,
187+ userMessages: UserMessages (),
188+ platform: FakePlatform (environment: < String , String > {}),
189+ );
190+
191+ expect (
192+ await localEngineLocator.findEnginePath (localEngine: localEngine.path),
193+ matchesEngineBuildPaths (
194+ hostEngine: '/arbitrary/engine/src/out/host_debug' ,
195+ targetEngine: '/arbitrary/engine/src/out/ios_debug_sim' ,
196+ ),
197+ );
198+ });
199+
200+ testWithoutContext ('works if local engine is simulator unoptimized' ,
201+ () async {
202+ final FileSystem fileSystem = MemoryFileSystem .test ();
203+ final Directory localEngine = fileSystem
204+ .directory ('$kArbitraryEngineRoot /src/out/ios_debug_sim_unopt/' )
205+ ..createSync (recursive: true );
206+ fileSystem
207+ .directory ('$kArbitraryEngineRoot /src/out/host_debug_unopt/' )
208+ .createSync (recursive: true );
209+
210+ final BufferLogger logger = BufferLogger .test ();
211+ final LocalEngineLocator localEngineLocator = LocalEngineLocator (
212+ fileSystem: fileSystem,
213+ flutterRoot: 'flutter/flutter' ,
214+ logger: logger,
215+ userMessages: UserMessages (),
216+ platform: FakePlatform (environment: < String , String > {}),
217+ );
218+
219+ expect (
220+ await localEngineLocator.findEnginePath (localEngine: localEngine.path),
221+ matchesEngineBuildPaths (
222+ hostEngine: '/arbitrary/engine/src/out/host_debug_unopt' ,
223+ targetEngine: '/arbitrary/engine/src/out/ios_debug_sim_unopt' ,
224+ ),
225+ );
226+ });
227+
173228 testWithoutContext ('fails if host_debug does not exist' , () async {
174229 final FileSystem fileSystem = MemoryFileSystem .test ();
175230 final Directory localEngine = fileSystem
0 commit comments