Index: test/runner/expanded_reporter_test.dart |
diff --git a/test/runner/compact_reporter_test.dart b/test/runner/expanded_reporter_test.dart |
similarity index 91% |
copy from test/runner/compact_reporter_test.dart |
copy to test/runner/expanded_reporter_test.dart |
index 4650b9fcc35e49382e7c40339ed2c42852a127d8..144e92bc03a3924c22ecb5afcf2bbaf296ebe1ef 100644 |
--- a/test/runner/compact_reporter_test.dart |
+++ b/test/runner/expanded_reporter_test.dart |
@@ -16,7 +16,8 @@ void main() { |
test("reports when no tests are run", () { |
return withTempDir((path) { |
new File(p.join(path, "test.dart")).writeAsStringSync("void main() {}"); |
- var result = runTest(["test.dart"], workingDirectory: path); |
+ var result = runTest(["-r", "expanded", "test.dart"], |
+ workingDirectory: path); |
expect(result.stdout, equals("No tests ran.\n")); |
}); |
}); |
@@ -28,11 +29,8 @@ void main() { |
test('success 3', () {});""", |
""" |
+0: success 1 |
- +1: success 1 |
+1: success 2 |
- +2: success 2 |
+2: success 3 |
- +3: success 3 |
+3: All tests passed!"""); |
}); |
@@ -47,19 +45,16 @@ void main() { |
oh no |
test.dart 6:33 main.<fn> |
- |
+0 -1: failure 2 |
+0 -2: failure 2 |
oh no |
test.dart 7:33 main.<fn> |
- |
+0 -2: failure 3 |
+0 -3: failure 3 |
oh no |
test.dart 8:33 main.<fn> |
- |
+0 -3: Some tests failed."""); |
}); |
@@ -75,17 +70,13 @@ void main() { |
oh no |
test.dart 6:33 main.<fn> |
- |
+0 -1: success 1 |
- +1 -1: success 1 |
+1 -1: failure 2 |
+1 -2: failure 2 |
oh no |
test.dart 8:33 main.<fn> |
- |
+1 -2: success 2 |
- +2 -2: success 2 |
+2 -2: Some tests failed."""); |
}); |
@@ -122,9 +113,7 @@ void main() { |
dart:async Future.Future.microtask |
test.dart 12:15 main.<fn> |
- |
+0 -1: wait |
- +1 -1: wait |
+1 -1: Some tests failed."""); |
}); |
@@ -143,8 +132,6 @@ void main() { |
two |
three |
four |
- |
- +1: test |
+1: All tests passed!"""); |
}); |
@@ -169,15 +156,12 @@ void main() { |
return testDone.future; |
});""", """ |
+0: test |
- +1: test |
+1: wait |
+1: test |
one |
two |
three |
four |
- |
- +2: wait |
+2: All tests passed!"""); |
}); |
@@ -209,7 +193,6 @@ void main() { |
+0: test |
one |
two |
- |
+0 -1: test |
first error |
test.dart 24:11 main.<fn> |
@@ -224,9 +207,7 @@ void main() { |
five |
six |
- |
+0 -1: wait |
- +1 -1: wait |
+1 -1: Some tests failed."""); |
}); |
}); |
@@ -239,11 +220,8 @@ void main() { |
test('skip 3', () {}, skip: true);""", |
""" |
+0: skip 1 |
- +0 ~1: skip 1 |
+0 ~1: skip 2 |
- +0 ~2: skip 2 |
+0 ~2: skip 3 |
- +0 ~3: skip 3 |
+0 ~3: All tests skipped."""); |
}); |
@@ -255,13 +233,9 @@ void main() { |
test('success 2', () {});""", |
""" |
+0: skip 1 |
- +0 ~1: skip 1 |
+0 ~1: success 1 |
- +1 ~1: success 1 |
+1 ~1: skip 2 |
- +1 ~2: skip 2 |
+1 ~2: success 2 |
- +2 ~2: success 2 |
+2 ~2: All tests passed!"""); |
}); |
@@ -279,21 +253,15 @@ void main() { |
oh no |
test.dart 6:35 main.<fn> |
- |
+0 -1: skip 1 |
- +0 ~1 -1: skip 1 |
+0 ~1 -1: success 1 |
- +1 ~1 -1: success 1 |
+1 ~1 -1: failure 2 |
+1 ~1 -2: failure 2 |
oh no |
test.dart 9:35 main.<fn> |
- |
+1 ~1 -2: skip 2 |
- +1 ~2 -2: skip 2 |
+1 ~2 -2: success 2 |
- +2 ~2 -2: success 2 |
+2 ~2 -2: Some tests failed."""); |
}); |
@@ -305,11 +273,9 @@ void main() { |
+0: skip 1 |
+0 ~1: skip 1 |
Skip: some reason |
- |
+0 ~1: skip 2 |
+0 ~2: skip 2 |
Skip: or another |
- |
+0 ~2: All tests skipped."""); |
}); |
}); |
@@ -332,13 +298,14 @@ $tests |
expect(withTempDir((path) { |
new File(p.join(path, "test.dart")).writeAsStringSync(dart); |
if (args == null) args = []; |
- args = args.toList()..add("test.dart"); |
- args.add("--concurrency=$concurrency"); |
+ args = args.toList() |
+ ..add("test.dart") |
+ ..add("--concurrency=$concurrency") |
+ ..add("--reporter=expanded"); |
var result = runTest(args, workingDirectory: path); |
- // Convert CRs into newlines, remove excess trailing whitespace, and trim |
- // off timestamps. |
- var actual = result.stdout.trim().split(new RegExp(r"[\r\n]")).map((line) { |
+ // Remove excess trailing whitespace and trim off timestamps. |
+ var actual = result.stdout.trim().split("\n").map((line) { |
if (line.startsWith(" ") || line.isEmpty) return line.trimRight(); |
return line.trim().replaceFirst(new RegExp("^[0-9]{2}:[0-9]{2} "), ""); |
}).join("\n"); |