mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

* Use source list from the compiler to track invalidated files. * Revert accidental change * Fix first-time-seen-the-file logic * Fix/simplify invalidate logic now that we can rely on compiler to let us know what is the cut-off point for invalidation. * Update devfs mock to accommodate for new fields * Fix deleted files case * Analyzer found missing final
34 lines
1.1 KiB
Dart
34 lines
1.1 KiB
Dart
// Copyright 2019 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'package:file/memory.dart';
|
|
import 'package:flutter_tools/src/base/file_system.dart';
|
|
import 'package:flutter_tools/src/run_hot.dart';
|
|
|
|
import 'src/common.dart';
|
|
import 'src/context.dart';
|
|
|
|
void main() {
|
|
group('ProjectFileInvalidator', () {
|
|
final MemoryFileSystem memoryFileSystem = MemoryFileSystem();
|
|
testUsingContext('Empty project', () async {
|
|
expect(
|
|
ProjectFileInvalidator.findInvalidated(lastCompiled: DateTime.now(), urisToMonitor: <Uri>[]),
|
|
isEmpty);
|
|
}, overrides: <Type, Generator>{
|
|
FileSystem: () => memoryFileSystem,
|
|
});
|
|
|
|
testUsingContext('Non-existent files are ignored', () async {
|
|
expect(
|
|
ProjectFileInvalidator.findInvalidated(
|
|
lastCompiled: DateTime.now(),
|
|
urisToMonitor: <Uri>[Uri.parse('/not-there-anymore')]),
|
|
isEmpty);
|
|
}, overrides: <Type, Generator>{
|
|
FileSystem: () => memoryFileSystem,
|
|
});
|
|
});
|
|
}
|