Files
sdk/pkg/analyzer_cli/test/perf_report_test.dart
T
Brian Wilkerson a10f6aac38 Finish cleaning up the copyright notices in the analyzer_cli package
Change-Id: I4de3c9e17b4e569c32470ffd1c2061749d3184ed
Reviewed-on: https://dart-review.googlesource.com/c/88439
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-06 19:16:31 +00:00

22 lines
804 B
Dart

// 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.
import 'dart:convert' show json;
import 'package:analyzer_cli/src/error_formatter.dart' show AnalysisStats;
import 'package:analyzer_cli/src/options.dart';
import 'package:analyzer_cli/src/perf_report.dart';
import 'package:test/test.dart';
main() {
test('makePerfReport', () {
var options = CommandLineOptions.parse(["somefile.dart"]);
var encoded = makePerfReport(1000, 1234, options, 0, new AnalysisStats());
var jsonData = json.decode(encoded);
expect(jsonData['totalElapsedTime'], 234);
expect(jsonData['options']['sourceFiles'], ["somefile.dart"]);
});
}