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

Unified Diff: pkg/analyzer/lib/file_system/memory_file_system.dart

Issue 2392793003: Fix some failures on the windows bots (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/file_system/memory_file_system.dart
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index 34a483960ea5d000a98fd2155a1ad447f2d92b9b..60ad8493e70ea5d60570956aba61447d7738a165 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -44,6 +44,21 @@ class MemoryResourceProvider implements ResourceProvider {
pathos.Context get pathContext => _pathContext;
/**
+ * Convert the given posix [path] to conform to this provider's path context.
+ *
+ * This is a utility method for testing; paths passed in to other methods in
+ * this class are never converted automatically.
+ */
+ String convertPath(String path) {
+ if (pathContext == pathos.windows &&
+ path.startsWith(pathos.posix.separator)) {
+ path = r'C:' +
+ path.replaceAll(pathos.posix.separator, pathos.windows.separator);
+ }
+ return path;
+ }
+
+ /**
* Delete the file with the given path.
*/
void deleteFile(String path) {
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698