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

Unified Diff: tests/corelib/src/RegExpAllMatchesTest.dart

Issue 9664052: - Fix use of String operator + in language and corelib tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | tests/language/src/CallThroughGetterTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/src/RegExpAllMatchesTest.dart
===================================================================
--- tests/corelib/src/RegExpAllMatchesTest.dart (revision 6413)
+++ tests/corelib/src/RegExpAllMatchesTest.dart (working copy)
@@ -31,22 +31,22 @@
static testForEach() {
var matches = new RegExp("foo").allMatches("foo foo");
- var str = "";
+ var strbuf = new StringBuffer();
matches.forEach((Match m) {
- str += m.group(0);
+ strbuf.add(m.group(0));
});
- Expect.equals("foofoo", str);
+ Expect.equals("foofoo", strbuf.toString());
}
static testMap() {
var matches = new RegExp("foo?").allMatches("foo fo foo fo");
- var mapped = matches.map((Match m) => m.group(0) + "bar");
+ var mapped = matches.map((Match m) => "${m.group(0)}bar");
Expect.equals(4, mapped.length);
- var str = "";
+ var strbuf = new StringBuffer();
for (String s in mapped) {
- str += s;
+ strbuf.add(s);
}
- Expect.equals("foobarfobarfoobarfobar", str);
+ Expect.equals("foobarfobarfoobarfobar", strbuf.toString());
}
static testFilter() {
@@ -55,11 +55,11 @@
return m.group(0) == 'foo';
});
Expect.equals(2, filtered.length);
- var str = "";
+ var strbuf = new StringBuffer();
for (Match m in filtered) {
- str += m.group(0);
+ strbuf.add(m.group(0));
}
- Expect.equals("foofoo", str);
+ Expect.equals("foofoo", strbuf.toString());
}
static testEvery() {
« no previous file with comments | « no previous file | tests/language/src/CallThroughGetterTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698