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

Side by Side Diff: tests/compiler/dart2js/analyze_only_test.dart

Issue 12431009: Add --analyze-signatures-only option to dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Smoke test of the dart2js compiler API. 5 // Smoke test of the dart2js compiler API.
6 library analyze_only; 6 library analyze_only;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 }""", 101 }""",
102 ['--analyze-only'], 102 ['--analyze-only'],
103 (String code, List errors, List warnings) { 103 (String code, List errors, List warnings) {
104 Expect.isNull(code); 104 Expect.isNull(code);
105 Expect.isTrue(errors.isEmpty); 105 Expect.isTrue(errors.isEmpty);
106 Expect.equals(1, warnings.length); 106 Expect.equals(1, warnings.length);
107 Expect.equals('Warning: cannot resolve type Foo', warnings[0].toString()); 107 Expect.equals('Warning: cannot resolve type Foo', warnings[0].toString());
108 }); 108 });
109 109
110 runCompiler( 110 runCompiler(
111 """main() {
112 Foo foo; // Unresolved and analyzed.
113 }""",
114 ['--analyze-only', '--analyze-signatures-only'],
115 (String code, List errors, List warnings) {
116 Expect.isNull(code);
117 Expect.isTrue(errors.isEmpty);
118 Expect.isTrue(warnings.isEmpty);
119 });
120
121 runCompiler(
111 "Foo foo; // Unresolved and analyzed.", 122 "Foo foo; // Unresolved and analyzed.",
112 ['--analyze-only', '--analyze-all'], 123 ['--analyze-only', '--analyze-all'],
113 (String code, List errors, List warnings) { 124 (String code, List errors, List warnings) {
114 Expect.isNull(code); 125 Expect.isNull(code);
115 Expect.isTrue(errors.isEmpty); 126 Expect.isTrue(errors.isEmpty);
116 Expect.equals('Warning: cannot resolve type Foo', warnings[0].toString()); 127 Expect.equals('Warning: cannot resolve type Foo', warnings[0].toString());
117 }); 128 });
118 129
119 runCompiler( 130 runCompiler(
120 """Foo foo; // Unresolved and analyzed. 131 """Foo foo; // Unresolved and analyzed.
121 main() {}""", 132 main() {}""",
122 ['--analyze-only', '--analyze-all'], 133 ['--analyze-only', '--analyze-all'],
123 (String code, List errors, List warnings) { 134 (String code, List errors, List warnings) {
124 Expect.isNull(code); 135 Expect.isNull(code);
125 Expect.isTrue(errors.isEmpty); 136 Expect.isTrue(errors.isEmpty);
126 Expect.equals(1, warnings.length); 137 Expect.equals(1, warnings.length);
127 Expect.equals('Warning: cannot resolve type Foo', warnings[0].toString()); 138 Expect.equals('Warning: cannot resolve type Foo', warnings[0].toString());
128 }); 139 });
129 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698