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/unittest.dart'; | 8 import 'package:test/test.dart'; |
9 | 9 |
10 import 'package:dev_compiler/src/testing.dart'; | 10 import 'package:dev_compiler/src/testing.dart'; |
11 import 'package:dev_compiler/src/report.dart'; | 11 import 'package:dev_compiler/src/report.dart'; |
12 import 'package:dev_compiler/src/summary.dart'; | 12 import 'package:dev_compiler/src/summary.dart'; |
13 | 13 |
14 import 'test_util.dart'; | |
15 | |
16 void main() { | 14 void main() { |
17 configureTest(); | |
18 | |
19 test('toJson/parse', () { | 15 test('toJson/parse', () { |
20 var files = { | 16 var files = { |
21 '/main.dart': ''' | 17 '/main.dart': ''' |
22 import 'package:foo/bar.dart'; | 18 import 'package:foo/bar.dart'; |
23 | 19 |
24 test1() { | 20 test1() { |
25 x = /*severe:StaticTypeError*/"hi"; | 21 x = /*severe:StaticTypeError*/"hi"; |
26 } | 22 } |
27 '''.replaceAll('\n ', '\n'), | 23 '''.replaceAll('\n ', '\n'), |
28 'package:foo/bar.dart': ''' | 24 'package:foo/bar.dart': ''' |
(...skipping 27 matching lines...) Expand all Loading... |
56 expect(barMessage.level, "info"); | 52 expect(barMessage.level, "info"); |
57 expect(barMessage.span.text, 'x'); | 53 expect(barMessage.span.text, 'x'); |
58 expect(barMessage.span.context, ' int y = /*info:AssignmentCast*/x;\n'); | 54 expect(barMessage.span.context, ' int y = /*info:AssignmentCast*/x;\n'); |
59 } | 55 } |
60 | 56 |
61 var original = reporter.result; | 57 var original = reporter.result; |
62 _verifySummary(original); | 58 _verifySummary(original); |
63 _verifySummary(GlobalSummary.parse(original.toJsonMap())); | 59 _verifySummary(GlobalSummary.parse(original.toJsonMap())); |
64 }); | 60 }); |
65 } | 61 } |
OLD | NEW |