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

Unified Diff: sdk/lib/_internal/pub/test/build/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
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/build/warns_on_assets_paths_test.dart
diff --git a/sdk/lib/_internal/pub/test/build/warns_on_assets_paths_test.dart b/sdk/lib/_internal/pub/test/build/warns_on_assets_paths_test.dart
index 67eb1b5925ae2f0a19faca1fe9a8b2ddeccf7bbb..90c69f0b9bcb3c4da7e1ef375b753705715a602f 100644
--- a/sdk/lib/_internal/pub/test/build/warns_on_assets_paths_test.dart
+++ b/sdk/lib/_internal/pub/test/build/warns_on_assets_paths_test.dart
@@ -9,9 +9,13 @@ import 'package:path/path.dart' as path;
import '../descriptor.dart' as d;
import '../test_pub.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("\\", "\\\\");
nweiz 2013/12/19 19:34:34 We should have a regExpQuote function in utils (wi
Bob Nystrom 2013/12/19 23:31:12 Since this is already in, I don't think it's worth
nweiz 2013/12/19 23:36:05 I'm uncomfortable with the idea of TBRing somethin
Bob Nystrom 2013/12/27 22:53:01 Gah, you're exactly right. I apologize.
+ return new RegExp(
+ '^Warning: Pub reserves paths containing "assets" for using assets from '
nweiz 2013/12/19 19:34:34 Use r"" strings for these.
Bob Nystrom 2013/12/19 23:31:12 The second line is using interpolation, and I thin
+ 'packages\\. Please rename the path "$assetsPath"\\.\$');
+}
main() {
initConfig();
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698