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

Unified Diff: tests/compiler/dart2js/diagnostic_helper.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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
Index: tests/compiler/dart2js/diagnostic_helper.dart
diff --git a/tests/compiler/dart2js/diagnostic_helper.dart b/tests/compiler/dart2js/diagnostic_helper.dart
index d87579fafc542899795d70bbfa2a0b59190e87a3..7d82a3d4677d5e4f9620e28d051ce42879274cac 100644
--- a/tests/compiler/dart2js/diagnostic_helper.dart
+++ b/tests/compiler/dart2js/diagnostic_helper.dart
@@ -6,12 +6,10 @@ library dart2js.test.diagnostic_helper;
import 'dart:collection';
-import 'package:compiler/compiler_new.dart' show
- CompilerDiagnostics,
- Diagnostic;
-import 'package:compiler/src/diagnostics/messages.dart' show
- Message,
- MessageKind;
+import 'package:compiler/compiler_new.dart'
+ show CompilerDiagnostics, Diagnostic;
+import 'package:compiler/src/diagnostics/messages.dart'
+ show Message, MessageKind;
import 'package:expect/expect.dart';
class CollectedMessage {
@@ -29,7 +27,7 @@ class CollectedMessage {
String toString() {
return '${message != null ? message.kind : ''}'
- ':$uri:$begin:$end:$text:$kind';
+ ':$uri:$begin:$end:$text:$kind';
}
}
@@ -37,14 +35,14 @@ class DiagnosticCollector implements CompilerDiagnostics {
List<CollectedMessage> messages = <CollectedMessage>[];
@override
- void report(Message message,
- Uri uri, int begin, int end, String text, Diagnostic kind) {
+ void report(Message message, Uri uri, int begin, int end, String text,
+ Diagnostic kind) {
messages.add(new CollectedMessage(message, uri, begin, end, text, kind));
}
Iterable<CollectedMessage> filterMessagesByKinds(List<Diagnostic> kinds) {
- return messages.where(
- (CollectedMessage message) => kinds.contains(message.kind));
+ return messages
+ .where((CollectedMessage message) => kinds.contains(message.kind));
}
Iterable<CollectedMessage> get errors {
@@ -78,16 +76,16 @@ class DiagnosticCollector implements CompilerDiagnostics {
void checkMessages(List<Expected> expectedMessages) {
int index = 0;
- Iterable<CollectedMessage> messages =
- filterMessagesByKinds(
- [Diagnostic.ERROR,
- Diagnostic.WARNING,
- Diagnostic.HINT,
- Diagnostic.INFO]);
+ Iterable<CollectedMessage> messages = filterMessagesByKinds([
+ Diagnostic.ERROR,
+ Diagnostic.WARNING,
+ Diagnostic.HINT,
+ Diagnostic.INFO
+ ]);
for (CollectedMessage message in messages) {
if (index >= expectedMessages.length) {
Expect.fail("Unexpected messages:\n "
- "${messages.skip(index).join('\n ')}");
+ "${messages.skip(index).join('\n ')}");
} else {
Expected expected = expectedMessages[index];
Expect.equals(expected.messageKind, message.messageKind,
@@ -119,18 +117,14 @@ class Expected {
: this(messageKind, Diagnostic.INFO);
}
-
-void compareWarningKinds(String text,
- List expectedWarnings,
- Iterable<CollectedMessage> foundWarnings) {
+void compareWarningKinds(String text, List expectedWarnings,
+ Iterable<CollectedMessage> foundWarnings) {
compareMessageKinds(text, expectedWarnings, foundWarnings, 'warning');
}
/// [expectedMessages] must be a list of either [MessageKind] or [CheckMessage].
-void compareMessageKinds(String text,
- List expectedMessages,
- Iterable<CollectedMessage> foundMessages,
- String kind) {
+void compareMessageKinds(String text, List expectedMessages,
+ Iterable<CollectedMessage> foundMessages, String kind) {
var fail = (message) => Expect.fail('$text: $message');
HasNextIterator expectedIterator =
new HasNextIterator(expectedMessages.iterator);
@@ -181,7 +175,7 @@ CheckMessage checkMessage(MessageKind kind, Map arguments) {
String foundValue = '${message.arguments[key]}';
if (expectedValue != foundValue) {
return 'Expected argument $key with value $expectedValue, '
- 'found $foundValue.';
+ 'found $foundValue.';
}
}
return null;
« no previous file with comments | « tests/compiler/dart2js/diagnose_ambiguous_test.dart ('k') | tests/compiler/dart2js/diagnostic_reporter_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698