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

Unified Diff: pkg/scheduled_test/lib/src/descriptor/directory.dart

Issue 12313083: Always use POSIX path in Entry.load in scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/descriptor/entry.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/descriptor/directory.dart
diff --git a/pkg/scheduled_test/lib/src/descriptor/directory.dart b/pkg/scheduled_test/lib/src/descriptor/directory.dart
index 631d8734efb41cd8bca07f9fbde1a08aff425d18..978daef7a7e96f3d65c0217501515c25bf257fdd 100644
--- a/pkg/scheduled_test/lib/src/descriptor/directory.dart
+++ b/pkg/scheduled_test/lib/src/descriptor/directory.dart
@@ -14,6 +14,9 @@ import '../../scheduled_test.dart';
import '../utils.dart';
import 'utils.dart';
+/// A path builder to ensure that [load] uses POSIX paths.
+final path.Builder _path = new path.Builder(style: path.Style.posix);
+
/// A descriptor describing a directory containing multiple files.
class Directory extends descriptor.Entry {
/// The entries contained within this directory.
@@ -40,11 +43,11 @@ class Directory extends descriptor.Entry {
Stream<List<int>> load(String pathToLoad) {
return futureStream(new Future.immediate(null).then((_) {
- if (path.isAbsolute(pathToLoad)) {
+ if (_path.isAbsolute(pathToLoad)) {
throw "Can't load absolute path '$pathToLoad'.";
}
- var split = path.split(path.normalize(pathToLoad));
+ var split = _path.split(_path.normalize(pathToLoad));
if (split.isEmpty || split.first == '.' || split.first == '..') {
throw "Can't load '$pathToLoad' from within $nameDescription.";
}
@@ -63,7 +66,7 @@ class Directory extends descriptor.Entry {
if (remainingPath.isEmpty) {
return matchingEntries.first.read();
} else {
- return matchingEntries.first.load(path.joinAll(remainingPath));
+ return matchingEntries.first.load(_path.joinAll(remainingPath));
}
}
}));
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/descriptor/entry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698