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

Side by Side Diff: tests/lib/convert/encoding_test.dart

Issue 22872012: Remove Encoding-enum from dart:io and add interface in dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/websocket_impl.dart ('k') | tests/standalone/coverage_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6 import 'dart:async';
7 import 'dart:convert';
8 import 'unicode_tests.dart';
9 import '../../async_helper.dart';
10
11 void runTest(List<int> bytes, expected) {
12 var controller = new StreamController();
13 asyncStart();
14 UTF8.decodeStream(controller.stream).then((decoded) {
15 Expect.equals(expected, decoded);
16 asyncEnd();
17 });
18 int i = 0;
19 while (i < bytes.length) {
20 List nextChunk = [];
21 for (int j = 0; j < 3; j++) {
22 if (i < bytes.length) {
23 nextChunk.add(bytes[i]);
24 i++;
25 }
26 }
27 controller.add(nextChunk);
28 }
29 controller.close();
30 }
31
32
33 main() {
34 for (var test in UNICODE_TESTS) {
35 var bytes = test[0];
36 var expected = test[1];
37 runTest(bytes, expected);
38 }
39 }
OLDNEW
« no previous file with comments | « sdk/lib/io/websocket_impl.dart ('k') | tests/standalone/coverage_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698