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

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

Issue 2239303004: Normalize paths in PhysicalResourceProvider.getFile()/getFolder(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 e1f4a0029b2cb01ed223df9c4444d6832f990fb9..a7c7c1f089e5708021d11c47c1f480e36e043011 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -180,12 +180,6 @@ class FileTest extends _BaseTest {
expect(file.exists, isTrue);
}
- void test_toUri() {
- String path = '/foo/file.txt';
- File file = PhysicalResourceProvider.INSTANCE.getFile(path);
- expect(file.toUri(), new Uri.file(path));
- }
-
void test_shortName() {
expect(file.shortName, 'file.txt');
}
@@ -194,6 +188,12 @@ class FileTest extends _BaseTest {
expect(file.toString(), path);
}
+ void test_toUri() {
+ String path = '/foo/file.txt';
+ File file = PhysicalResourceProvider.INSTANCE.getFile(path);
+ expect(file.toUri(), new Uri.file(path));
+ }
+
void test_writeAsBytesSync() {
new io.File(path).writeAsBytesSync(<int>[1, 2]);
expect(file.readAsBytesSync(), <int>[1, 2]);
@@ -389,6 +389,13 @@ class FolderTest extends _BaseTest {
@reflectiveTest
class PhysicalResourceProviderTest extends _BaseTest {
+ test_getFolder_trailingSeparator() {
+ String path = tempPath;
+ PhysicalResourceProvider provider = PhysicalResourceProvider.INSTANCE;
+ Folder folder = provider.getFolder('$path$separator');
+ expect(folder.path, path);
+ }
+
test_getModificationTimes() async {
PhysicalResourceProvider provider = PhysicalResourceProvider.INSTANCE;
String path = join(tempPath, 'file1.txt');

Powered by Google App Engine
This is Rietveld 408576698