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

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

Issue 54723007: Fix warnings in library-tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 7 years, 1 month 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 | « tests/lib/convert/chunked_conversion1_test.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:convert'; 6 import 'dart:convert';
7 7
8 final TESTS = [ 8 final TESTS = [
9 [ 5, '5' ], 9 [ 5, '5' ],
10 [ -42, '-42' ], 10 [ -42, '-42' ],
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 return result; 111 return result;
112 } 112 }
113 113
114 Object decode6(String str) { 114 Object decode6(String str) {
115 Object result; 115 Object result;
116 var decoder = new JsonDecoder(null); 116 var decoder = new JsonDecoder(null);
117 ChunkedConversionSink objectSink = 117 ChunkedConversionSink objectSink =
118 new ChunkedConversionSink.withCallback((x) => result = x.single); 118 new ChunkedConversionSink.withCallback((x) => result = x.single);
119 var stringConversionSink = decoder.startChunkedConversion(objectSink); 119 var stringConversionSink = decoder.startChunkedConversion(objectSink);
120 ByteConversionSink inputByteSink = stringConversionSink.asUtf8Sink(false); 120 ByteConversionSink inputByteSink = stringConversionSink.asUtf8Sink(false);
121 Object tmpBytes = UTF8.encode(str); 121 var tmpBytes = UTF8.encode(str);
122 tmpBytes.forEach((b) => inputByteSink.addSlice([0, b, 1], 1, 2, false)); 122 tmpBytes.forEach((b) => inputByteSink.addSlice([0, b, 1], 1, 2, false));
123 inputByteSink.close(); 123 inputByteSink.close();
124 return result; 124 return result;
125 } 125 }
126 126
127 Object decode7(String str) { 127 Object decode7(String str) {
128 Object result; 128 Object result;
129 var decoder = new JsonDecoder(null); 129 var decoder = new JsonDecoder(null);
130 ChunkedConversionSink objectSink = 130 ChunkedConversionSink objectSink =
131 new ChunkedConversionSink.withCallback((x) => result = x.single); 131 new ChunkedConversionSink.withCallback((x) => result = x.single);
(...skipping 20 matching lines...) Expand all
152 var string = test[1]; 152 var string = test[1];
153 Expect.isTrue(isJsonEqual(o, decode(string))); 153 Expect.isTrue(isJsonEqual(o, decode(string)));
154 Expect.isTrue(isJsonEqual(o, decode2(string))); 154 Expect.isTrue(isJsonEqual(o, decode2(string)));
155 Expect.isTrue(isJsonEqual(o, decode3(string))); 155 Expect.isTrue(isJsonEqual(o, decode3(string)));
156 Expect.isTrue(isJsonEqual(o, decode4(string))); 156 Expect.isTrue(isJsonEqual(o, decode4(string)));
157 Expect.isTrue(isJsonEqual(o, decode5(string))); 157 Expect.isTrue(isJsonEqual(o, decode5(string)));
158 Expect.isTrue(isJsonEqual(o, decode6(string))); 158 Expect.isTrue(isJsonEqual(o, decode6(string)));
159 Expect.isTrue(isJsonEqual(o, decode7(string))); 159 Expect.isTrue(isJsonEqual(o, decode7(string)));
160 } 160 }
161 } 161 }
OLDNEW
« no previous file with comments | « tests/lib/convert/chunked_conversion1_test.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698