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 /// Tests for summary reporting. | 5 /// Tests for summary reporting. |
6 library dev_compiler.test.report_test; | 6 library dev_compiler.test.report_test; |
7 | 7 |
8 import 'package:unittest/compact_vm_config.dart'; | 8 import 'package:unittest/compact_vm_config.dart'; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 | 10 |
11 import 'package:dev_compiler/src/testing.dart'; | 11 import 'package:dev_compiler/src/testing.dart'; |
12 import 'package:dev_compiler/src/report.dart'; | 12 import 'package:dev_compiler/src/report.dart'; |
| 13 import 'package:dev_compiler/src/summary.dart'; |
13 | 14 |
14 main() { | 15 main() { |
15 useCompactVMConfiguration(); | 16 useCompactVMConfiguration(); |
16 test('toJson/parse', () { | 17 test('toJson/parse', () { |
17 var files = { | 18 var files = { |
18 '/main.dart': ''' | 19 '/main.dart': ''' |
19 import 'package:foo/bar.dart'; | 20 import 'package:foo/bar.dart'; |
20 | 21 |
21 test1() { | 22 test1() { |
22 x = /*severe:StaticTypeError*/"hi"; | 23 x = /*severe:StaticTypeError*/"hi"; |
(...skipping 13 matching lines...) Expand all Loading... |
36 var summary1 = reporter.result; | 37 var summary1 = reporter.result; |
37 expect(summary1.loose['file:///main.dart'].messages.length, 1); | 38 expect(summary1.loose['file:///main.dart'].messages.length, 1); |
38 var barUrl = 'package:foo/bar.dart'; | 39 var barUrl = 'package:foo/bar.dart'; |
39 expect(summary1.packages['foo'].libraries[barUrl].messages.length, 1); | 40 expect(summary1.packages['foo'].libraries[barUrl].messages.length, 1); |
40 | 41 |
41 var summary2 = GlobalSummary.parse(summary1.toJsonMap()); | 42 var summary2 = GlobalSummary.parse(summary1.toJsonMap()); |
42 expect(summary2.loose['file:///main.dart'].messages.length, 1); | 43 expect(summary2.loose['file:///main.dart'].messages.length, 1); |
43 expect(summary2.packages['foo'].libraries[barUrl].messages.length, 1); | 44 expect(summary2.packages['foo'].libraries[barUrl].messages.length, 1); |
44 }); | 45 }); |
45 } | 46 } |
OLD | NEW |