Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: test/report_test.dart

Issue 1788973002: Remove code that requires whole-program compile (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merged Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/dependency_graph_test.dart ('k') | test/testing.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/report_test.dart
diff --git a/test/report_test.dart b/test/report_test.dart
deleted file mode 100644
index 5d6f9ddc4dbf6d1574f72a095714c98e8c458335..0000000000000000000000000000000000000000
--- a/test/report_test.dart
+++ /dev/null
@@ -1,74 +0,0 @@
-// 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.
-
-/// Tests for summary reporting.
-library dev_compiler.test.report_test;
-
-import 'package:test/test.dart';
-
-import 'package:dev_compiler/devc.dart';
-
-import 'package:dev_compiler/src/analysis_context.dart';
-import 'package:dev_compiler/src/options.dart';
-import 'package:dev_compiler/src/report.dart';
-import 'package:dev_compiler/src/summary.dart';
-
-import 'testing.dart';
-
-void main() {
- test('toJson/parse', () {
- var files = {
- '/main.dart': '''
- import 'package:foo/bar.dart';
-
- test1() {
- x = "hi";
- }
- '''
- .replaceAll('\n ', '\n'),
- 'package:foo/bar.dart': '''
- List x;
- test2() {
- List<String> y = x;
- }
- '''
- .replaceAll('\n ', '\n'),
- };
-
- var provider = createTestResourceProvider(files);
- var uriResolver = new TestUriResolver(provider);
- var srcOpts = new SourceResolverOptions(useMockSdk: true);
- var context =
- createAnalysisContextWithSources(srcOpts, fileResolvers: [uriResolver]);
- var reporter = new SummaryReporter(context);
- new BatchCompiler(context, new CompilerOptions(sourceOptions: srcOpts),
- reporter: reporter)
- .compileFromUriString('/main.dart');
-
- _verifySummary(GlobalSummary summary) {
- var mainLib = summary.loose['file:///main.dart'];
- expect(mainLib.messages.length, 2);
- var analyzerMsg = mainLib.messages[0];
- expect(analyzerMsg.kind, "AnalyzerMessage");
-
- var mainMessage = mainLib.messages[1];
- expect(mainMessage.kind, "STATIC_TYPE_ERROR");
- expect(mainMessage.level, "error");
- expect(mainMessage.span.text, '"hi"');
- expect(mainMessage.span.context, ' x = "hi";\n');
-
- var barLib = summary.packages['foo'].libraries['package:foo/bar.dart'];
- expect(barLib.messages.length, 1);
- var barMessage = barLib.messages[0];
- expect(barMessage.kind, "DOWN_CAST_COMPOSITE");
- expect(barMessage.level, "warning");
- expect(barMessage.span.text, 'x');
- expect(barMessage.span.context, ' List<String> y = x;\n');
- }
-
- var original = reporter.result;
- _verifySummary(original);
- _verifySummary(GlobalSummary.parse(original.toJsonMap()));
- });
-}
« no previous file with comments | « test/dependency_graph_test.dart ('k') | test/testing.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698