OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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:dart2js_info/info.dart'; | 5 import 'package:dart2js_info/info.dart'; |
6 import 'package:test/test.dart'; | 6 import 'package:test/test.dart'; |
7 | 7 |
8 main() { | 8 main() { |
9 // TODO(sigmund): add more tests | 9 // TODO(sigmund): add more tests |
10 group('parse', () { | 10 group('parse', () { |
11 test('empty', () { | 11 test('empty', () { |
12 var json = { | 12 var json = { |
13 'elements': { | 13 'elements': { |
14 'library': {}, | 14 'library': {}, |
15 'class': {}, | 15 'class': {}, |
16 'function': {}, | 16 'function': {}, |
17 'field': {}, | 17 'field': {}, |
18 'typedef': {}, | 18 'typedef': {}, |
19 }, | 19 }, |
20 'holding': {}, | 20 'holding': {}, |
21 'program': {'size': 10}, | 21 'program': {'size': 10}, |
22 }; | 22 }; |
23 | 23 |
24 expect(new AllInfo.fromJson(json).program.size, 10); | 24 expect(new AllInfoJsonCodec().decode(json).program.size, 10); |
25 }); | 25 }); |
26 }); | 26 }); |
27 } | 27 } |
OLD | NEW |