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

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

Issue 1562023002: Add test of unittests. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 4 years, 11 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.test.message_kind_helper; 5 library dart2js.test.message_kind_helper;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 import 'package:compiler/src/commandline_options.dart'; 10 import 'package:compiler/src/commandline_options.dart';
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 for (CollectedMessage message in messages) { 117 for (CollectedMessage message in messages) {
118 if (!messageFound && checkMessage(message)) { 118 if (!messageFound && checkMessage(message)) {
119 messageFound = true; 119 messageFound = true;
120 } else { 120 } else {
121 unexpectedMessages.add(message); 121 unexpectedMessages.add(message);
122 } 122 }
123 } 123 }
124 Expect.isTrue(messageFound, 124 Expect.isTrue(messageFound,
125 '${template.kind}} does not match any in\n ' 125 '${template.kind}} does not match any in\n '
126 '${messages.join('\n ')}'); 126 '${messages.join('\n ')}');
127 Expect.isFalse(compiler.reporter.hasCrashed); 127 var reporter = compiler.reporter;
128 Expect.isFalse(reporter.hasCrashed);
128 if (!unexpectedMessages.isEmpty) { 129 if (!unexpectedMessages.isEmpty) {
129 for (CollectedMessage message in unexpectedMessages) { 130 for (CollectedMessage message in unexpectedMessages) {
130 print("Unexpected message: $message"); 131 print("Unexpected message: $message");
131 } 132 }
132 if (!kindsWithExtraMessages.contains(template.kind)) { 133 if (!kindsWithExtraMessages.contains(template.kind)) {
133 // Try changing the error reporting logic before adding an exception 134 // Try changing the error reporting logic before adding an exception
134 // to [kindsWithExtraMessages]. 135 // to [kindsWithExtraMessages].
135 throw 'Unexpected messages found.'; 136 throw 'Unexpected messages found.';
136 } 137 }
137 } 138 }
(...skipping 15 matching lines...) Expand all
153 kindsWithPendingClasses.contains(template)); 154 kindsWithPendingClasses.contains(template));
154 155
155 if (!pendingStuff) { 156 if (!pendingStuff) {
156 // If there is pending stuff, or the compiler was cancelled, we 157 // If there is pending stuff, or the compiler was cancelled, we
157 // shouldn't reuse the compiler. 158 // shouldn't reuse the compiler.
158 cachedCompiler = compiler; 159 cachedCompiler = compiler;
159 } 160 }
160 }); 161 });
161 }).then((_) => cachedCompiler); 162 }).then((_) => cachedCompiler);
162 } 163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698