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

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

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 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
Index: tests/standalone/io/mime_multipart_parser_test.dart
diff --git a/tests/standalone/io/mime_multipart_parser_test.dart b/tests/standalone/io/mime_multipart_parser_test.dart
index d9457c768b9f1629a402c99fd18463cf1bdaf400..506a46e6b7a518a0ab17bf573f121d48a2d0f55c 100644
--- a/tests/standalone/io/mime_multipart_parser_test.dart
+++ b/tests/standalone/io/mime_multipart_parser_test.dart
@@ -68,15 +68,13 @@ void testParse(String message,
if (chunkSize == -1) chunkSize = data.length;
reset();
int written = 0;
- int unparsed;
for (int pos = 0; pos < data.length; pos += chunkSize) {
int remaining = data.length - pos;
int writeLength = min(chunkSize, remaining);
- written += writeLength;
int parsed =
- parser.update(data.getRange(pos, writeLength), 0, writeLength);
- unparsed = writeLength - parsed;
- Expect.equals(0, unparsed);
+ parser.update(data.sublist(pos, pos + writeLength), 0, writeLength);
+ Expect.equals(writeLength, parsed);
+ written += writeLength;
}
Expect.isTrue(lastPartCalled);
}

Powered by Google App Engine
This is Rietveld 408576698