Remove checker tests which are covered by diagnostic tests
These tests are covered in current tests for
`argument_type_not_assignable`, and for `non_bool_condition`.
Change-Id: I727eebea5bf893857d132e270eeb7efca9acf3ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281308
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 564276e..44fd331 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -40,116 +40,6 @@
]);
}
- test_compoundAssignment_returnsDynamic() async {
- await assertNoErrorsInCode(r'''
-class Foo {
- operator +(other) => null;
-}
-
-main() {
- var foo = new Foo();
- foo = foo + 1;
- foo += 1;
-}
-''');
- }
-
- test_compoundAssignments() async {
- await assertErrorsInCode('''
-class A {
- A operator *(B b) => null;
- A operator /(B b) => null;
- A operator ~/(B b) => null;
- A operator %(B b) => null;
- A operator +(B b) => null;
- A operator -(B b) => null;
- A operator <<(B b) => null;
- A operator >>(B b) => null;
- A operator &(B b) => null;
- A operator ^(B b) => null;
- A operator |(B b) => null;
- D operator [](B index) => null;
- void operator []=(B index, D value) => null;
-}
-
-class B {
- A operator -(B b) => null;
-}
-
-class D {
- D operator +(D d) => null;
-}
-
-class SubA extends A {}
-class SubSubA extends SubA {}
-
-foo() => new A();
-
-test() {
- int x = 0;
- x += 5;
- x += 3.14;
-
- double y = 0.0;
- y += 5;
- y += 3.14;
-
- num z = 0;
- z += 5;
- z += 3.14;
-
- x = x + z;
- x += z;
- y = y + z;
- y += z;
-
- dynamic w = 42;
- x += w;
- y += w;
- z += w;
-
- A a = new A();
- B b = new B();
- var c = foo();
- a = a * b;
- a *= b;
- a *= c;
- a /= b;
- a ~/= b;
- a %= b;
- a += b;
- a += a;
- a -= b;
- b -= b;
- a <<= b;
- a >>= b;
- a &= b;
- a ^= b;
- a |= b;
- c += b;
-
- SubA sa;
- sa += b;
- SubSubA ssa = sa += b;
-
- var d = new D();
- a[b] += d;
- a[c] += d;
- a[z] += d;
- a[b] += c;
- a[b] += z;
- c[b] += d;
-}
-''', [
- error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 613, 4),
- error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 927, 1),
- error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 947, 1),
- error(HintCode.UNUSED_LOCAL_VARIABLE, 1045, 3),
- error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1110, 1),
- error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1142, 1),
- ]);
- }
-
@FailingTest(issue: 'dartbug.com/33440')
test_constantGenericTypeArg_explicit() async {
// Regression test for https://github.com/dart-lang/sdk/issues/26141
@@ -203,50 +93,6 @@
''');
}
- test_constructors() async {
- await assertErrorsInCode('''
-const num z = 25;
-Object obj = "world";
-
-class A {
- int x;
- String y;
-
- A(this.x) : this.y = 42;
-
- A.c1(p): this.x = z, this.y = p;
-
- A.c2(this.x, this.y);
-
- A.c3(num this.x, String this.y);
-}
-
-class B extends A {
- B() : super("hello");
-
- B.c2(int x, String y) : super.c2(y, x);
-
- B.c3(num x, Object y) : super.c3(x, y);
-}
-
-void main() {
- A a = new A.c2(z, z);
- var b = new B.c2("hello", obj);
-}
-''', [
- error(CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, 96, 2),
- error(CompileTimeErrorCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, 169,
- 10),
- error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 234, 7),
- error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 280, 1),
- error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 283, 1),
- error(HintCode.UNUSED_LOCAL_VARIABLE, 352, 1),
- error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 368, 1),
- error(HintCode.UNUSED_LOCAL_VARIABLE, 379, 1),
- error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 392, 7),
- ]);
- }
-
test_conversionAndDynamicInvoke() async {
newFile('$testPackageLibPath/helper.dart', r'''
dynamic toString = (int x) => x + 42;
@@ -1759,42 +1605,6 @@
]);
}
- test_ifForDoWhileStatementsUseBooleanConversion() async {
- await assertErrorsInCode('''
-main() {
- dynamic dyn = 42;
- Object obj = 42;
- int i = 42;
- bool b = false;
-
- if (b) {}
- if (dyn) {}
- if (obj) {}
- if (i) {}
-
- while (b) {}
- while (dyn) {}
- while (obj) {}
- while (i) {}
-
- do {} while (b);
- do {} while (dyn);
- do {} while (obj);
- do {} while (i);
-
- for (;b;) {}
- for (;dyn;) {}
- for (;obj;) {}
- for (;i;) {}
-}
-''', [
- error(CompileTimeErrorCode.NON_BOOL_CONDITION, 127, 1),
- error(CompileTimeErrorCode.NON_BOOL_CONDITION, 192, 1),
- error(CompileTimeErrorCode.NON_BOOL_CONDITION, 275, 1),
- error(CompileTimeErrorCode.NON_BOOL_CONDITION, 337, 1),
- ]);
- }
-
test_implicitDynamic_method() async {
_disableTestPackageImplicitDynamic();
await assertErrorsInCode(r'''