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

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 20117)
+++ intl/test/data_directory.dart (working copy)
@@ -13,6 +13,7 @@
*/
library data_directory;
+import "dart:io";
import "package:pathos/path.dart" as path;
String get dataDirectory {
@@ -40,8 +41,16 @@
if (foundIntlDir) {
return path.joinAll(pathUpToIntl);
} else {
- return path.join(path.current, 'pkg', 'intl');
+ if (new Directory(path.join(path.current, 'pkg', 'intl')).existsSync()) {
+ return path.join(path.current, 'pkg', 'intl');
+ }
+ if (new Directory(
+ path.join(path.current, '..', 'pkg', 'intl')).existsSync()) {
+ return path.join(path.current, '..', 'pkg', 'intl');
+ }
}
+ throw new UnsupportedError(
+ 'Cannot find ${path.join('pkg','intl')} directory.');
}
String get datesRelativeToIntl => path.join('lib', 'src', 'data', 'dates');
« 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