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

Side by Side Diff: test/codegen/lib/convert/codec2_test.dart

Issue 1978963002: Upgrade to the latest dart:convert. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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
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 'dart:convert'; 5 import 'dart:convert';
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 8
9 main() { 9 main() {
10 final RAW = '["122ç",50,50,231]'; 10 final RAW = '["122ç",50,50,231]';
(...skipping 20 matching lines...) Expand all
31 return v * 2; 31 return v * 2;
32 }); 32 });
33 decoded = jsonWithReviver.decode('{"p": 5}'); 33 decoded = jsonWithReviver.decode('{"p": 5}');
34 Expect.equals(10, decoded["p"]); 34 Expect.equals(10, decoded["p"]);
35 35
36 // Test example from comments. 36 // Test example from comments.
37 final JSON_TO_BYTES = JSON.fuse(UTF8); 37 final JSON_TO_BYTES = JSON.fuse(UTF8);
38 List<int> bytes = JSON_TO_BYTES.encode(["json-object"]); 38 List<int> bytes = JSON_TO_BYTES.encode(["json-object"]);
39 decoded = JSON_TO_BYTES.decode(bytes); 39 decoded = JSON_TO_BYTES.decode(bytes);
40 Expect.isTrue(decoded is List); 40 Expect.isTrue(decoded is List);
41 Expect.equals("json-object", decoded[0]); 41 Expect.equals("json-object", (decoded as List)[0]);
42 } 42 }
OLDNEW
« no previous file with comments | « test/codegen/lib/convert/chunked_conversion1_test.dart ('k') | test/codegen/lib/convert/html_escape_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698