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

Unified Diff: tests/corelib/string_trim2_test.dart

Issue 196533015: Fix bug in trim introduced by rewrite. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: without debug prints. Created 6 years, 9 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/js_string.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_trim2_test.dart
diff --git a/tests/corelib/string_trim2_test.dart b/tests/corelib/string_trim2_test.dart
index fc894a25901de46665ef7f48035e8f9e89cac9f8..11379dd77618014c9e72034e4216053b2fd8ee75 100644
--- a/tests/corelib/string_trim2_test.dart
+++ b/tests/corelib/string_trim2_test.dart
@@ -36,14 +36,14 @@ const WHITESPACE = const [
main() {
for (var ws in WHITESPACE) {
- Expect.equals("", new String.fromCharCode(ws).trim());
- }
- Expect.equals("", new String.fromCharCodes(WHITESPACE).trim());
- for (var ws in WHITESPACE) {
+ var name = ws.toRadixString(16);
var c = new String.fromCharCode(ws);
- Expect.equals("a", ("a" + c).trim());
- Expect.equals("a", (c + "a").trim());
- Expect.equals("a", (c + c + "a" + c + c).trim());
- Expect.equals("a" + c + "a", (c + c + "a" + c + "a" + c + c).trim());
+ Expect.equals("", c.trim(), "$name");
+ Expect.equals("a", ("a" + c).trim(), "a-$name");
+ Expect.equals("a", (c + "a").trim(), "$name-a");
+ Expect.equals("a", (c + c + "a" + c + c).trim(), "$name around");
+ Expect.equals("a" + c + "a", (c + c + "a" + c + "a" + c + c).trim(),
+ "$name many");
}
+ Expect.equals("", new String.fromCharCodes(WHITESPACE).trim(), "ALL");
}
« no previous file with comments | « sdk/lib/_internal/lib/js_string.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698