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 library analyzer_cli.test.perf_report; | 5 library analyzer_cli.test.perf_report; |
6 | 6 |
7 import 'dart:convert' show JSON; | 7 import 'dart:convert' show JSON; |
8 | 8 |
| 9 import 'package:analyzer_cli/src/analyzer_options.dart'; |
9 import 'package:analyzer_cli/src/error_formatter.dart' show AnalysisStats; | 10 import 'package:analyzer_cli/src/error_formatter.dart' show AnalysisStats; |
10 import 'package:analyzer_cli/src/options.dart'; | |
11 import 'package:analyzer_cli/src/perf_report.dart'; | 11 import 'package:analyzer_cli/src/perf_report.dart'; |
12 import 'package:test/test.dart'; | 12 import 'package:test/test.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 test('makePerfReport', () { | 15 test('makePerfReport', () { |
16 var options = CommandLineOptions.parse(["somefile.dart"]); | 16 var options = CommandLineOptions.parse(["somefile.dart"]); |
17 var encoded = makePerfReport(1000, 1234, options, 0, new AnalysisStats()); | 17 var encoded = makePerfReport(1000, 1234, options, 0, new AnalysisStats()); |
18 | 18 |
19 var json = JSON.decode(encoded); | 19 var json = JSON.decode(encoded); |
20 expect(json['totalElapsedTime'], 234); | 20 expect(json['totalElapsedTime'], 234); |
21 expect(json['options']['sourceFiles'], ["somefile.dart"]); | 21 expect(json['options']['sourceFiles'], ["somefile.dart"]); |
22 }); | 22 }); |
23 } | 23 } |
OLD | NEW |