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

Unified Diff: packages/which/test/util.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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 | « packages/which/test/test.dart ('k') | packages/which/test/which_impl_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/which/test/util.dart
diff --git a/packages/which/test/util.dart b/packages/which/test/util.dart
new file mode 100755
index 0000000000000000000000000000000000000000..b02e54902c46dadc1505d1631057680ecfe37117
--- /dev/null
+++ b/packages/which/test/util.dart
@@ -0,0 +1,38 @@
+
+library which.test.util;
+
+import 'dart:io';
+
+import 'package:mockito/mockito.dart';
+import 'package:path/path.dart' as path;
+import 'package:which/src/candidate_paths.dart';
+
+getPosixCandidatePaths(String command, String pathVar, String current) {
+ var env = {
+ 'PATH': pathVar
+ };
+ var isWindows = false;
+ var context = new path.Context(style: path.Style.posix, current: current);
+
+ return getCandidatePaths(command, env, isWindows, context);
+}
+
+getWindowsCandidatePaths(String command, String pathVar, String pathExtVar, String current) {
+ var env = {
+ 'PATH': pathVar,
+ 'PATHEXT': pathExtVar
+ };
+ var isWindows = true;
+ var context = new path.Context(style: path.Style.windows, current: current);
+
+ return getCandidatePaths(command, env, isWindows, context);
+}
+
+class MockFileStat extends Mock implements FileStat {
+
+ MockFileStat();
+
+ noSuchMethod(i) => super.noSuchMethod(i);
+}
+
+int parseBinary(String b) => int.parse(b, radix: 2);
« no previous file with comments | « packages/which/test/test.dart ('k') | packages/which/test/which_impl_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698