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

Unified Diff: tests/standalone/io/http_session_test.dart

Issue 13548002: Add Iterable.fold (and Stream.fold) which replace `reduce`. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 | « tests/standalone/io/http_proxy_test.dart ('k') | tests/standalone/io/https_client_certificate_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_session_test.dart
diff --git a/tests/standalone/io/http_session_test.dart b/tests/standalone/io/http_session_test.dart
index 69f6a6b0d9b0f096099903986311ba635886a182..5648bd0597871a63a18b39e3948ef5a799c05b9b 100644
--- a/tests/standalone/io/http_session_test.dart
+++ b/tests/standalone/io/http_session_test.dart
@@ -8,7 +8,7 @@ import 'dart:io';
const SESSION_ID = "DARTSESSID";
String getSessionId(List<Cookie> cookies) {
- var id = cookies.reduce(null, (last, cookie) {
+ var id = cookies.fold(null, (last, cookie) {
if (last != null) return last;
if (cookie.name.toUpperCase() == SESSION_ID) {
Expect.isTrue(cookie.httpOnly);
@@ -30,7 +30,7 @@ Future<String> connectGetSession(
return request.close();
})
.then((response) {
- return response.reduce(getSessionId(response.cookies), (v, _) => v);
+ return response.fold(getSessionId(response.cookies), (v, _) => v);
});
}
« no previous file with comments | « tests/standalone/io/http_proxy_test.dart ('k') | tests/standalone/io/https_client_certificate_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698