Add helper methods testNTI and testOTI.
So that I can see them in a stack trace and know which one failed.
@@ -81,19 +81,39 @@ public abstract class TypeICompilerTestCase extends CompilerTestCase {
DiagnosticType warning,
String description) {
if (this.mode.runsOTI()) {
+ testOTI(externs, js, expected, error, warning, description);
+ }
+ if (this.mode.runsNTI()) {
+ testNTI(externs, js, expected, error, warning, description);
+ }
+ if (this.mode.runsNeither()) {
+ super.test(externs, js, expected, error, warning, description);
+ }
+ }
+
+ private void testOTI(
+ List<SourceFile> externs,
+ String js,
+ String expected,
+ DiagnosticType error,
+ DiagnosticType warning,
+ String description) {
enableTypeCheck();
super.test(externs, js, expected, error, warning, description);
disableTypeCheck();
}
- if (this.mode.runsNTI()) {
+
+ private void testNTI(
+ List<SourceFile> externs,
+ String js,
+ String expected,
+ DiagnosticType error,
+ DiagnosticType warning,
+ String description) {
enableNewTypeInference();
super.test(externs, js, expected, error, warning, description);
disableNewTypeInference();
}
- if (this.mode.runsNeither()) {
- super.test(externs, js, expected, error, warning, description);
- }
- }
@Override
public void test(
