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

Unified Diff: pkg/analyzer/test/generated/test_support.dart

Issue 975453004: Reformat (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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: pkg/analyzer/test/generated/test_support.dart
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index b4ea7b28e6ce0aa481fed914221ee51ecb0991dd..c59d37577bcf790379d78dfb04ffbf03ff448b8c 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -18,7 +18,6 @@ import 'package:analyzer/src/generated/java_engine.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:unittest/unittest.dart';
-
/**
* The class `EngineTestCase` defines utility methods for making assertions.
*/
@@ -107,8 +106,8 @@ class EngineTestCase {
* @return the object that was being tested
* @throws Exception if the object is not an instance of the expected class
*/
- static Object assertInstanceOf(Predicate<Object> predicate,
- Type expectedClass, Object object) {
+ static Object assertInstanceOf(
+ Predicate<Object> predicate, Type expectedClass, Object object) {
if (!predicate(object)) {
fail(
"Expected instance of $expectedClass, found ${object == null ? "null" : object.runtimeType}");
@@ -119,8 +118,8 @@ class EngineTestCase {
/**
* @return the [AstNode] with requested type at offset of the "prefix".
*/
- static AstNode findNode(AstNode root, String code, String prefix,
- Predicate<AstNode> predicate) {
+ static AstNode findNode(
+ AstNode root, String code, String prefix, Predicate<AstNode> predicate) {
int offset = code.indexOf(prefix);
if (offset == -1) {
throw new IllegalArgumentException("Not found '$prefix'.");
@@ -222,16 +221,14 @@ class GatheringErrorListener implements AnalysisErrorListener {
* @throws AssertionFailedError if a different number of errors have been gathered than were
* expected
*/
- void assertErrorsWithCodes([List<ErrorCode> expectedErrorCodes =
- ErrorCode.EMPTY_LIST]) {
+ void assertErrorsWithCodes(
+ [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) {
StringBuffer buffer = new StringBuffer();
//
// Verify that the expected error codes have a non-empty message.
//
for (ErrorCode errorCode in expectedErrorCodes) {
- expect(
- errorCode.message.isEmpty,
- isFalse,
+ expect(errorCode.message.isEmpty, isFalse,
reason: "Empty error code message");
}
//
@@ -446,25 +443,21 @@ class GatheringErrorListener implements AnalysisErrorListener {
buffer.writeln();
if (lineInfo == null) {
int offset = error.offset;
- StringUtils.printf(
- buffer,
- " %s %s (%d..%d)",
- [
- source == null ? "" : source.shortName,
- error.errorCode,
- offset,
- offset + error.length]);
+ StringUtils.printf(buffer, " %s %s (%d..%d)", [
+ source == null ? "" : source.shortName,
+ error.errorCode,
+ offset,
+ offset + error.length
+ ]);
} else {
LineInfo_Location location = lineInfo.getLocation(error.offset);
- StringUtils.printf(
- buffer,
- " %s %s (%d, %d/%d)",
- [
- source == null ? "" : source.shortName,
- error.errorCode,
- location.lineNumber,
- location.columnNumber,
- error.length]);
+ StringUtils.printf(buffer, " %s %s (%d, %d/%d)", [
+ source == null ? "" : source.shortName,
+ error.errorCode,
+ location.lineNumber,
+ location.columnNumber,
+ error.length
+ ]);
}
}
buffer.writeln();
@@ -477,27 +470,23 @@ class GatheringErrorListener implements AnalysisErrorListener {
buffer.writeln();
if (lineInfo == null) {
int offset = error.offset;
- StringUtils.printf(
- buffer,
- " %s %s (%d..%d): %s",
- [
- source == null ? "" : source.shortName,
- error.errorCode,
- offset,
- offset + error.length,
- error.message]);
+ StringUtils.printf(buffer, " %s %s (%d..%d): %s", [
+ source == null ? "" : source.shortName,
+ error.errorCode,
+ offset,
+ offset + error.length,
+ error.message
+ ]);
} else {
LineInfo_Location location = lineInfo.getLocation(error.offset);
- StringUtils.printf(
- buffer,
- " %s %s (%d, %d/%d): %s",
- [
- source == null ? "" : source.shortName,
- error.errorCode,
- location.lineNumber,
- location.columnNumber,
- error.length,
- error.message]);
+ StringUtils.printf(buffer, " %s %s (%d, %d/%d): %s", [
+ source == null ? "" : source.shortName,
+ error.errorCode,
+ location.lineNumber,
+ location.columnNumber,
+ error.length,
+ error.message
+ ]);
}
}
fail(buffer.toString());
@@ -559,7 +548,6 @@ class TestLogger implements Logger {
}
}
-
class TestSource extends Source {
String _name;
String _contents;
« no previous file with comments | « pkg/analyzer/test/generated/static_warning_code_test.dart ('k') | pkg/analyzer/test/generated/utilities_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698