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

Unified Diff: tests/corelib/string_replace_dollar_test.dart

Issue 251373006: Fix dart2js replace to escape all dollar characters in the replacement string. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « sdk/lib/_internal/lib/string_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/string_replace_dollar_test.dart
diff --git a/tests/corelib/string_replace_dollar_test.dart b/tests/corelib/string_replace_dollar_test.dart
index 6a684f0be392f1bcb361384b54698c1368611fd3..c0077a05965d7e1ede883b8db9f830eb8ebdfa24 100644
--- a/tests/corelib/string_replace_dollar_test.dart
+++ b/tests/corelib/string_replace_dollar_test.dart
@@ -16,4 +16,12 @@ main() {
Expect.equals(jsText, htmlOut);
htmlOut = htmlStr.replaceFirst(new RegExp("%%DART"), jsText);
Expect.equals(jsText, htmlOut);
+
+ // Regression test, http://dartbug.com/17886
+ String doubleDollar = r"$'$`";
+ var string = r"flip-flip-flop";
+ var result = string.replaceFirst("flip", doubleDollar);
+ Expect.equals(r"$'$`-flip-flop", result);
+ result = string.replaceAll("flip", doubleDollar);
+ Expect.equals(r"$'$`-$'$`-flop", result);
}
« no previous file with comments | « sdk/lib/_internal/lib/string_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698