Index: utils/tests/pub/install/path/nonexistent_dir_test.dart |
diff --git a/utils/tests/pub/install/path/nonexistent_dir_test.dart b/utils/tests/pub/install/path/nonexistent_dir_test.dart |
index 324a37b3c532a8e64897b7dd4263017dec99e88c..4a129f465e36658498cbde604e031ae7320922d7 100644 |
--- a/utils/tests/pub/install/path/nonexistent_dir_test.dart |
+++ b/utils/tests/pub/install/path/nonexistent_dir_test.dart |
@@ -23,9 +23,15 @@ main() { |
}) |
]).scheduleCreate(); |
+ // TODO(rnystrom): The "\" in a Windows path gets treated like a regex |
+ // character, so hack escape. A better fix is to use a literal string |
+ // instead of a RegExp to validate, but that requires us to move the |
+ // stack traces out of the stderr when we invoke pub. See also: #4706. |
+ var escapePath = badPath.replaceAll(r"\", r"\\"); |
+ |
schedulePub(args: ['install'], |
error: |
- new RegExp("Could not find package 'foo' at '$badPath'."), |
+ new RegExp("Could not find package 'foo' at '$escapePath'."), |
exitCode: exit_codes.DATA); |
}); |
} |