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

Unified Diff: pkg/analyzer/test/file_system/memory_file_system_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/memory_file_system_test.dart
diff --git a/pkg/analyzer/test/file_system/memory_file_system_test.dart b/pkg/analyzer/test/file_system/memory_file_system_test.dart
index ecd647e1b1185236573c7613072c0e9d9916f263..2dd95de9dd419e478ad486ee7817758c45bba982 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -17,7 +17,7 @@ import 'package:watcher/watcher.dart';
var _isFile = new isInstanceOf<File>();
var _isFolder = new isInstanceOf<Folder>();
-var _isMemoryResourceException = new isInstanceOf<MemoryResourceException>();
+var _isFileSystemException = new isInstanceOf<FileSystemException>();
main() {
@@ -30,13 +30,13 @@ main() {
provider = new MemoryResourceProvider();
});
- test('MemoryResourceException', () {
- var exception = new MemoryResourceException('/my/path', 'my message');
+ test('FileSystemException', () {
+ var exception = new FileSystemException('/my/path', 'my message');
expect(exception.path, '/my/path');
expect(exception.message, 'my message');
expect(
exception.toString(),
- 'MemoryResourceException(path=/my/path; message=my message)');
+ 'FileSystemException(path=/my/path; message=my message)');
});
group('Watch', () {
@@ -281,6 +281,23 @@ main() {
expect(file.isOrContains('/foo/bar'), isFalse);
});
+ group('modificationStamp', () {
+ test('exists', () {
+ String path = '/foo/bar/file.txt';
+ File file = provider.newFile(path, 'qwerty');
+ expect(file.modificationStamp, isNonNegative);
+ });
+
+ test('does not exist', () {
+ String path = '/foo/bar/file.txt';
+ File file = provider.newFile(path, 'qwerty');
+ provider.deleteFile(path);
+ expect(() {
+ file.modificationStamp;
+ }, throwsA(_isFileSystemException));
+ });
+ });
+
test('shortName', () {
File file = provider.getResource('/foo/bar/file.txt');
expect(file.shortName, 'file.txt');
@@ -485,7 +502,7 @@ main() {
test('contents', () {
expect(() {
source.contents;
- }, throwsA(_isMemoryResourceException));
+ }, throwsA(_isFileSystemException));
});
test('encoding', () {
@@ -500,6 +517,10 @@ main() {
expect(source.fullName, '/foo/test.dart');
});
+ test('modificationStamp', () {
+ expect(source.modificationStamp, -1);
+ });
+
test('shortName', () {
expect(source.shortName, 'test.dart');
});

Powered by Google App Engine
This is Rietveld 408576698