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

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

Issue 2165843002: Add a toUri method to Resource (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added tests Created 4 years, 5 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 2787ce2ca08736402270f17ca580a2c76e1305a7..5c931b144489e8ba1ae3bcb187f4b4fd9d9d3159 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -204,6 +204,12 @@ class FileTest {
expect(file.toString(), '/foo/bar/file.txt');
}
+ void test_toUri() {
+ String path = '/foo/file.txt';
+ File file = provider.newFile(path, '');
+ expect(file.toUri(), new Uri.file(path, windows: false));
+ }
+
void test_writeAsBytesSync_existing() {
File file = provider.newFileWithBytes('/foo/file.bin', <int>[1, 2]);
expect(file.readAsBytesSync(), <int>[1, 2]);
@@ -387,6 +393,12 @@ class FolderTest {
expect(parent2.path, equals('/'));
expect(parent2.parent, isNull);
}
+
+ void test_toUri() {
+ String path = '/foo/directory';
+ Folder folder = provider.newFolder(path);
+ expect(folder.toUri(), new Uri.directory(path, windows: false));
+ }
}
@reflectiveTest
@@ -539,6 +551,13 @@ class MemoryResourceProviderTest {
expect(file.exists, isFalse);
}
+ test_getModificationTimes() async {
+ File file = provider.newFile('/test.dart', '');
+ Source source = file.createSource();
+ List<int> times = await provider.getModificationTimes([source]);
+ expect(times, [source.modificationStamp]);
+ }
+
void test_getStateLocation_uniqueness() {
String idOne = 'one';
Folder folderOne = provider.getStateLocation(idOne);
@@ -615,13 +634,6 @@ class MemoryResourceProviderTest {
}, throwsA(new isInstanceOf<ArgumentError>()));
}
- test_getModificationTimes() async {
- File file = provider.newFile('/test.dart', '');
- Source source = file.createSource();
- List<int> times = await provider.getModificationTimes([source]);
- expect(times, [source.modificationStamp]);
- }
-
test_watch_createFile() {
String rootPath = '/my/path';
provider.newFolder(rootPath);

Powered by Google App Engine
This is Rietveld 408576698