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

Unified Diff: intl/test/data_directory.dart

Issue 12787011: - Make test code fail when run from unexpected location. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/
Patch Set: Created 7 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: intl/test/data_directory.dart
===================================================================
--- intl/test/data_directory.dart (revision 19940)
+++ intl/test/data_directory.dart (working copy)
@@ -14,12 +14,18 @@
String get _sep => Platform.pathSeparator;
get dataDirectory {
- var current = new Directory.current().path;
+ var dir = new Directory.current();
+ var current = dir.path;
if (new RegExp('.*${_sep}test').hasMatch(current)) {
return '..${_sep}lib${_sep}src${_sep}data${_sep}dates${_sep}';
}
if (new RegExp('.*${_sep}intl').hasMatch(current)) {
return 'lib${_sep}src${_sep}data${_sep}dates${_sep}';
}
- return 'pkg${_sep}intl${_sep}lib${_sep}src${_sep}data${_sep}dates${_sep}';
+ if (new Directory('${dir.path}${_sep}pkg').existsSync()) {
kustermann 2013/03/15 22:21:36 Use current instead of dir.path?
Ivan Posva 2013/03/15 22:25:57 Changed all instances to cwd instead.
+ return 'pkg${_sep}intl${_sep}lib${_sep}src${_sep}data${_sep}dates${_sep}';
+ } else if (new Directory('${dir.path}${_sep}..${_sep}pkg').existsSync()) {
+ return '..${_sep}pkg${_sep}intl${_sep}lib${_sep}src${_sep}data${_sep}dates${_sep}';
kustermann 2013/03/15 22:21:36 long line
Ivan Posva 2013/03/15 22:25:57 Done.
+ }
+ throw new UnsupportedError('Cannot find pkg${_sep}intl directory');
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698