Index: pkg/testing/lib/src/multitest.dart |
diff --git a/pkg/testing/lib/src/multitest.dart b/pkg/testing/lib/src/multitest.dart |
index 4679633922f1f2e97e14429022fb4a1d9935df7d..1efbabe71384cc87b2ba3dc715d1ebb2ce5f396a 100644 |
--- a/pkg/testing/lib/src/multitest.dart |
+++ b/pkg/testing/lib/src/multitest.dart |
@@ -18,17 +18,29 @@ import 'log.dart' show |
import 'test_description.dart' show |
TestDescription; |
+bool isError(Set<String> expectations) { |
+ if (expectations.contains("compile-time error")) return true; |
+ if (expectations.contains("runtime error")) return true; |
+ if (expectations.contains("dynamic type error")) return true; |
karlklose
2017/01/16 07:57:58
Is this annotation intended for strong mode? We di
ahe
2017/01/16 08:37:44
Not sure. I assumed it was for checked mode. Perha
ahe
2017/01/18 11:25:31
Following up in CL 2641833002.
|
+ return false; |
+} |
+ |
+bool isCheckedModeError(Set<String> expectations) { |
+ if (expectations.contains("checked mode compile-time error")) return true; |
+ return isError(expectations); |
+} |
+ |
class MultitestTransformer |
implements StreamTransformer<TestDescription, TestDescription> { |
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 = |
@@ -113,6 +125,7 @@ class MultitestTransformer |
Uri uri = generated.uri.resolve("${name}_generated.dart"); |
TestDescription subtest = |
new TestDescription(root, new File.fromUri(uri)); |
+ subtest.multitestExpectations = outcomes[name]; |
await subtest.file.writeAsString(lines.join("")); |
yield subtest; |
} |