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

Unified Diff: sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart

Issue 110853007: Escape "\" in regex to unbreak Windows bot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
Index: sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart
diff --git a/sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart b/sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart
index 467cf09cabeddc6ec9b90a2872253e1aedb57587..c4ae0c5dd1a53ac0370d2d621bb3ddd901fa15c5 100644
--- a/sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart
+++ b/sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart
@@ -11,9 +11,13 @@ import '../descriptor.dart' as d;
import '../test_pub.dart';
import 'utils.dart';
-getWarningRegExp(String assetsPath) => new RegExp(
- '^Warning: Pub reserves paths containing "assets" for using assets from '
- 'packages\\. Please rename the path "$assetsPath"\\.\$');
+getWarningRegExp(String assetsPath) {
+ // Escape backslashes since they are metacharacters in a regex.
+ assetsPath = assetsPath.replaceAll("\\", "\\\\");
+ return new RegExp(
+ '^Warning: Pub reserves paths containing "assets" for using assets from '
+ 'packages\\. Please rename the path "$assetsPath"\\.\$');
+}
main() {
initConfig();

Powered by Google App Engine
This is Rietveld 408576698