diff --git a/test/data_directory.dart b/test/data_directory.dart index 3485201..0b07b98 100644 --- a/test/data_directory.dart +++ b/test/data_directory.dart @@ -23,14 +23,11 @@ bool _isIntlRoot(String dir) { } String get packageDirectory { - // TODO(alanknight): We can also do this using mirrors, which may - // be better. See dart_style/test/utils.dart for an example. + // Try the current directory. + if (_isIntlRoot(Directory.current.path)) return Directory.current.path; + + // Search upwards from the script location. var script = Platform.script; - // If being run in package:test, we're in an isolate with a data URI, so - // just assume the current directory is the package. - if (script.scheme == 'data') { - return Directory.current.path; - } var dir = path.fromUri(Platform.script); var root = path.rootPrefix(dir);