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

Unified Diff: test/rules/prefer_is_not_empty.dart

Issue 1419373009: Lint to prefer x.isNotEmpty vs. !x.isEmpty (#143). (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: doc fix. Created 5 years, 1 month 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 | « lib/src/sdk.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/rules/prefer_is_not_empty.dart
diff --git a/test/_data/p4/lib/lib1.dart b/test/rules/prefer_is_not_empty.dart
similarity index 51%
copy from test/_data/p4/lib/lib1.dart
copy to test/rules/prefer_is_not_empty.dart
index 083ff6fd68126469e314cff0d8f8bf7630173acb..155ed523f9b997b86288f3a3a5399acde86a3604 100644
--- a/test/_data/p4/lib/lib1.dart
+++ b/test/rules/prefer_is_not_empty.dart
@@ -2,12 +2,12 @@
// 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.
-library lib1;
+bool lne = ![].isEmpty; //LINT [12:11]
+bool mne = !{}.isEmpty; //LINT
+bool ine = !iterable.isEmpty; //LINT
-import 'package:p4/lib2.dart';
+bool le = [].isEmpty;
+bool me = {}.isEmpty;
+bool ie = iterable.isEmpty;
-import 'lib3.dart';
-
-void test() {
- f(g());
-}
+Iterable get iterable => [];
« no previous file with comments | « lib/src/sdk.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698