anchor.diff:  
     testWithoutContext('EngineCachedArtifact removes unzipped FlutterMacOS.framework before replacing', () async {
       final OperatingSystemUtils operatingSystemUtils = FakeOperatingSystemUtils();
  -    final MockCache cache = MockCache();
       final FileSystem fileSystem = MemoryFileSystem.test();
       final Directory artifactDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
       final Directory downloadDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_download.');
  -
  -    when(cache.getArtifactDirectory(any)).thenReturn(artifactDir);
  -    when(cache.getDownloadDir()).thenReturn(downloadDir);
  +    final FakeSecondaryCache cache = FakeSecondaryCache()
  +      ..artifactDirectory = artifactDir
  +      ..downloadDir = downloadDir;
  +
       final Directory binDir = artifactDir.childDirectory('bin_dir')..createSync();
       binDir.childFile('FlutterMacOS.framework.zip').createSync();
       final Directory unzippedFramework = binDir.childDirectory('FlutterMacOS.framework');
  
positive.code:     testWithoutContext('Continues on failed stamp file update', () async {
        final FileSystem fileSystem = MemoryFileSystem.test();
        final BufferLogger logger = BufferLogger.test();
        final Cache mockCache = MockCache();
        final Directory artifactDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
        final Directory downloadDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_download.');
  
        when(mockCache.getVersionFor(any)).thenReturn('asdasd');
        when(mockCache.getArtifactDirectory(any)).thenReturn(artifactDir);
        when(mockCache.getDownloadDir()).thenReturn(downloadDir);
        when(mockCache.setStampFor(any, any)).thenAnswer((_) {
          throw const FileSystemException('stamp write failed');
        });
        final FakeSimpleArtifact artifact = FakeSimpleArtifact(mockCache);
        await artifact.update(FakeArtifactUpdater(), logger, fileSystem, FakeOperatingSystemUtils());
  
        expect(logger.errorText, contains('stamp write failed'));
  
negative.code:     testWithoutContext('Continues on missing version file', () async {
        final FileSystem fileSystem = MemoryFileSystem.test();
        final BufferLogger logger = BufferLogger.test();
        final Directory artifactDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
        final Directory downloadDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_download.');
        final Cache cache = FakeSecondaryCache()
          ..version = null // version is missing.
          ..artifactDirectory = artifactDir
          ..downloadDir = downloadDir;
  
        final FakeSimpleArtifact artifact = FakeSimpleArtifact(cache);
        await artifact.update(FakeArtifactUpdater(), logger, fileSystem, FakeOperatingSystemUtils());
  
        expect(logger.errorText, contains('No known version for the artifact name "fake"'));
  