| 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 ddc.test.report_test; | 6 library ddc.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 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 test2() { | 27 test2() { |
| 28 int y = /*info:DownCast*/x; | 28 int y = /*info:DownCast*/x; |
| 29 } | 29 } |
| 30 ''', | 30 ''', |
| 31 }; | 31 }; |
| 32 testChecker(files); | 32 testChecker(files); |
| 33 var reporter = new SummaryReporter(); | 33 var reporter = new SummaryReporter(); |
| 34 testChecker(files, reporter: reporter); | 34 testChecker(files, reporter: reporter); |
| 35 | 35 |
| 36 var summary1 = reporter.result; | 36 var summary1 = reporter.result; |
| 37 expect(summary1.loose['main'].messages.length, 1); | 37 expect(summary1.loose['file:///main.dart'].messages.length, 1); |
| 38 expect(summary1.packages['foo'].libraries['bar'].messages.length, 1); | 38 var barUrl = 'package:foo/bar.dart'; |
| 39 expect(summary1.packages['foo'].libraries[barUrl].messages.length, 1); |
| 39 | 40 |
| 40 var summary2 = GlobalSummary.parse(summary1.toJsonMap()); | 41 var summary2 = GlobalSummary.parse(summary1.toJsonMap()); |
| 41 expect(summary2.loose['main'].messages.length, 1); | 42 expect(summary2.loose['file:///main.dart'].messages.length, 1); |
| 42 expect(summary2.packages['foo'].libraries['bar'].messages.length, 1); | 43 expect(summary2.packages['foo'].libraries[barUrl].messages.length, 1); |
| 43 }); | 44 }); |
| 44 } | 45 } |
| OLD | NEW |