Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1714)

Unified Diff: pkg/analyzer/test/file_system/physical_resource_provider_test.dart

Issue 940313003: Add File.modificationStamp accessor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/file_system/physical_resource_provider_test.dart
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index c1c09ca753ca501453939a62280dd645b0d296d5..3ba46e898290f598ebca2f8fa5191392562f1925 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -17,6 +17,7 @@ import 'package:watcher/watcher.dart';
var _isFile = new isInstanceOf<File>();
var _isFolder = new isInstanceOf<Folder>();
+var _isFileSystemException = new isInstanceOf<FileSystemException>();
main() {
@@ -199,6 +200,21 @@ main() {
expect(file.isOrContains('foo'), isFalse);
});
+ group('modificationStamp', () {
+ test('exists', () {
+ new io.File(path).writeAsStringSync('contents');
+ File file = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(file.modificationStamp, isNonNegative);
+ });
+
+ test('does not exist', () {
+ File file = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(() {
+ file.modificationStamp;
+ }, throwsA(_isFileSystemException));
+ });
+ });
+
test('shortName', () {
expect(file.shortName, 'file.txt');
});

Powered by Google App Engine
This is Rietveld 408576698