Index: pkg/analyzer_cli/test/perf_report_test.dart |
diff --git a/pkg/analyzer_cli/test/perf_report_test.dart b/pkg/analyzer_cli/test/perf_report_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c5707ac18b6977fbae18c1a7146685c34eb3c594 |
--- /dev/null |
+++ b/pkg/analyzer_cli/test/perf_report_test.dart |
@@ -0,0 +1,23 @@ |
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+library analyzer_cli.test.perf_report; |
+ |
+import 'dart:convert' show JSON; |
+ |
+import 'package:unittest/unittest.dart'; |
+ |
+import 'package:analyzer_cli/src/options.dart'; |
+import 'package:analyzer_cli/src/perf_report.dart'; |
+ |
+main() { |
+ test('makePerfReport', () { |
+ var options = CommandLineOptions.parse(["somefile.dart"]); |
+ var encoded = makePerfReport(1000, 1234, options); |
+ |
+ var json = JSON.decode(encoded); |
+ expect(json['totalElapsedTime'], 234); |
+ expect(json['options']['sourceFiles'], ["somefile.dart"]); |
+ }); |
+} |