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

Unified Diff: pkg/testing/lib/src/multitest.dart

Issue 2743423009: Run dartfmt on remaining unformated pkg packages (Closed)
Patch Set: Run dartfmt on remaining unformated pkg packages Created 3 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
Index: pkg/testing/lib/src/multitest.dart
diff --git a/pkg/testing/lib/src/multitest.dart b/pkg/testing/lib/src/multitest.dart
index 5d4d1232071fa8aaf9971e867ea7be9373d2b8a0..2e819e8ad3863cbdaa1ac8bb1451ad8bfc56b199 100644
--- a/pkg/testing/lib/src/multitest.dart
+++ b/pkg/testing/lib/src/multitest.dart
@@ -4,19 +4,13 @@
library testing.multitest;
-import 'dart:async' show
- Stream,
- StreamTransformer;
+import 'dart:async' show Stream, StreamTransformer;
-import 'dart:io' show
- Directory,
- File;
+import 'dart:io' show Directory, File;
-import 'log.dart' show
- splitLines;
+import 'log.dart' show splitLines;
-import 'test_description.dart' show
- TestDescription;
+import 'test_description.dart' show TestDescription;
bool isError(Set<String> expectations) {
if (expectations.contains("compile-time error")) return true;
@@ -35,13 +29,13 @@ class MultitestTransformer
static const String multitestMarker = "///";
static const List<String> validOutcomesList = const <String>[
- "ok",
- "compile-time error",
- "runtime error",
- "static type warning",
- "dynamic type error",
- "checked mode compile-time error",
- ];
+ "ok",
+ "compile-time error",
+ "runtime error",
+ "static type warning",
+ "dynamic type error",
+ "checked mode compile-time error",
+ ];
static final Set<String> validOutcomes =
new Set<String>.from(validOutcomesList);
@@ -52,7 +46,9 @@ class MultitestTransformer
errors.add(error);
print(error);
}
- nextTest: await for (TestDescription test in stream) {
+
+ nextTest:
+ await for (TestDescription test in stream) {
String contents = await test.file.readAsString();
if (!contents.contains(multitestMarker)) {
yield test;
@@ -78,16 +74,19 @@ class MultitestTransformer
index = annotationText.indexOf(":");
if (index != -1) {
subtestName = annotationText.substring(0, index).trim();
- subtestOutcomesList = annotationText.substring(index + 1).split(",")
- .map((s) => s.trim()).toList();
+ subtestOutcomesList = annotationText
+ .substring(index + 1)
+ .split(",")
+ .map((s) => s.trim())
+ .toList();
if (subtestName == "none") {
reportError(test.formatError(
- "$lineNumber: $subtestName can't be used as test name."));
+ "$lineNumber: $subtestName can't be used as test name."));
continue nextTest;
}
if (subtestOutcomesList.isEmpty) {
- reportError(test.formatError(
- "$lineNumber: Expected <testname>:<outcomes>"));
+ reportError(test
+ .formatError("$lineNumber: Expected <testname>:<outcomes>"));
continue nextTest;
}
}
@@ -96,8 +95,8 @@ class MultitestTransformer
List<String> lines = testsAsLines.putIfAbsent(subtestName,
() => new List<String>.from(linesWithoutAnnotations));
lines.add(line);
- Set<String> subtestOutcomes = outcomes.putIfAbsent(subtestName,
- () => new Set<String>());
+ Set<String> subtestOutcomes =
+ outcomes.putIfAbsent(subtestName, () => new Set<String>());
if (subtestOutcomesList.length != 1 ||
subtestOutcomesList.single != "continued") {
for (String outcome in subtestOutcomesList) {
@@ -105,7 +104,7 @@ class MultitestTransformer
subtestOutcomes.add(outcome);
} else {
reportError(test.formatError(
- "$lineNumber: '$outcome' isn't a recognized outcome."));
+ "$lineNumber: '$outcome' isn't a recognized outcome."));
continue nextTest;
}
}

Powered by Google App Engine
This is Rietveld 408576698