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

Unified Diff: test/rules/dont_compare_unrelated_types_for_equality.dart

Issue 1972183002: Linter version 0.1.16 bump [TBR]. (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « pubspec.yaml ('k') | test/rules/unrelated_type_equality_checks.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/rules/dont_compare_unrelated_types_for_equality.dart
diff --git a/test/rules/dont_compare_unrelated_types_for_equality.dart b/test/rules/dont_compare_unrelated_types_for_equality.dart
deleted file mode 100644
index f14abbcfaef76d4c3a02666b7e103b22deba2f5a..0000000000000000000000000000000000000000
--- a/test/rules/dont_compare_unrelated_types_for_equality.dart
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// test w/ `dart test/util/solo_test.dart dont_compare_unrelated_types_for_equality`
-
-void someFunction() {
- var x = '1';
- if (x == 1) print('someFunction'); // LINT
-}
-
-void someFunction1() {
- String x = '1';
- if (x == 1) print('someFunction1'); // LINT
-}
-
-void someFunction2() {
- var x = '1';
- var y = '2';
- if (x == y) print(someFunction2); // OK
-}
-
-void someFunction3() {
- for (var i = 0; i < 10; i++) {
- if (i == 0) print(someFunction3); // OK
- }
-}
-
-void someFunction4() {
- var x = '1';
- if (x == null) print(someFunction4); // OK
-}
-
-void someFunction5(Object object) {
- List<ClassBase> someList;
-
- for (ClassBase someInstance in someList) {
- if (object == someInstance) print('someFunction5'); // OK
- }
-}
-
-void someFunction6(Object object) {
- List someList;
-
- for (var someInstance in someList) {
- if (object == someInstance) print('someFunction6'); // OK
- }
-}
-
-void someFunction7() {
- List someList;
-
- if (someList.length == 0) print('someFunction7'); // OK
-}
-
-void someFunction8(ClassBase instance) {
- DerivedClass1 other;
-
- if (other == instance) print('someFunction8'); // OK
-}
-
-void someFunction9(ClassBase instance) {
- var other = new DerivedClass1();
-
- if (other == instance) print('someFunction9'); // OK
-}
-
-void someFunction10(unknown) {
- var what = unknown - 1;
- for (var index = 0; index < unknown; index++) {
- if (what == index) print('someFunction10'); // OK
- }
-}
-
-void someFunction11(Mixin instance) {
- var other = new DerivedClass2();
-
- if (other == instance) print('someFunction11'); // OK
-}
-
-void someFunction12(Mixin instance) {
- var other = new DerivedClass3();
-
- if (other == instance) print('someFunction12'); // OK
-}
-
-void someFunction13(DerivedClass2 instance) {
- var other = new DerivedClass3();
-
- if (other == instance) print('someFunction13'); // OK
-}
-
-void someFunction14(DerivedClass4 instance) {
- var other = new DerivedClass5();
-
- if (other == instance) print('someFunction15'); // LINT
-}
-
-class ClassBase {}
-
-class DerivedClass1 extends ClassBase {}
-
-abstract class Mixin {}
-
-class DerivedClass2 extends ClassBase with Mixin {}
-
-class DerivedClass3 extends ClassBase implements Mixin {}
-
-class DerivedClass4 extends DerivedClass2 {}
-
-class DerivedClass5 extends DerivedClass3 {}
« no previous file with comments | « pubspec.yaml ('k') | test/rules/unrelated_type_equality_checks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698