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

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

Issue 677423002: Fix assertion not holding (calling with start==end) and typo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « runtime/lib/convert_patch.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library test; 5 library test;
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import "dart:convert"; 8 import "dart:convert";
9 import "unicode_tests.dart" show UNICODE_TESTS; 9 import "unicode_tests.dart" show UNICODE_TESTS;
10 10
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 sink.add(codes.sublist(i, j)); 229 sink.add(codes.sublist(i, j));
230 sink.add(codes.sublist(j)); 230 sink.add(codes.sublist(j));
231 sink.close(); 231 sink.close();
232 }); 232 });
233 } 233 }
234 } 234 }
235 } 235 }
236 236
237 // Test that `codeString.codeUnits` fails to parse as UTF-8 JSON, 237 // Test that `codeString.codeUnits` fails to parse as UTF-8 JSON,
238 // even with decoder not throwing on malformed encodings. 238 // even with decoder not throwing on malformed encodings.
239 void jsonThrows(Strig name, String codeString) { 239 void jsonThrows(String name, String codeString) {
240 testJsonThrows(tag, action) { 240 testJsonThrows(tag, action) {
241 // Not allowing malformed, expect throw. 241 // Not allowing malformed, expect throw.
242 var sink = new ChunkedConversionSink.withCallback((values) { 242 var sink = new ChunkedConversionSink.withCallback((values) {
243 Expect.unreachable(tag); 243 Expect.unreachable(tag);
244 }); 244 });
245 var decoderSink = JSON.decoder.startChunkedConversion(sink) 245 var decoderSink = JSON.decoder.startChunkedConversion(sink)
246 .asUtf8Sink(true); 246 .asUtf8Sink(true);
247 Expect.throws(() { action(decoderSink); }, null, tag); 247 Expect.throws(() { action(decoderSink); }, null, tag);
248 } 248 }
249 249
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 sink.add(bytes.sublist(0, i)); 441 sink.add(bytes.sublist(0, i));
442 sink.add(bytes.sublist(i, j)); 442 sink.add(bytes.sublist(i, j));
443 sink.add(bytes.sublist(j)); 443 sink.add(bytes.sublist(j));
444 sink.add([0x22]); 444 sink.add([0x22]);
445 sink.close(); 445 sink.close();
446 }); 446 });
447 } 447 }
448 } 448 }
449 } 449 }
450 } 450 }
OLDNEW
« no previous file with comments | « runtime/lib/convert_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698