| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.generated.non_hint_code_test; | 5 library analyzer.test.generated.non_hint_code_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/error.dart'; | 7 import 'package:analyzer/src/generated/error.dart'; |
| 8 import 'package:analyzer/src/generated/source_io.dart'; | 8 import 'package:analyzer/src/generated/source_io.dart'; |
| 9 | 9 |
| 10 import '../reflective_tests.dart'; | 10 import '../reflective_tests.dart'; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 Source source = addSource(r''' | 151 Source source = addSource(r''' |
| 152 const bool DEBUG = true; | 152 const bool DEBUG = true; |
| 153 f() { | 153 f() { |
| 154 bool b = DEBUG || true; | 154 bool b = DEBUG || true; |
| 155 }'''); | 155 }'''); |
| 156 computeLibrarySourceErrors(source); | 156 computeLibrarySourceErrors(source); |
| 157 assertNoErrors(source); | 157 assertNoErrors(source); |
| 158 verify([source]); | 158 verify([source]); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void test_deadCode_statementAfterIfWithoutElse() { | |
| 162 Source source = addSource(r''' | |
| 163 f() { | |
| 164 if (1 < 0) { | |
| 165 return; | |
| 166 } | |
| 167 int a = 1; | |
| 168 }'''); | |
| 169 computeLibrarySourceErrors(source); | |
| 170 assertNoErrors(source); | |
| 171 verify([source]); | |
| 172 } | |
| 173 | |
| 174 void test_deprecatedMemberUse_inDeprecatedClass() { | 161 void test_deprecatedMemberUse_inDeprecatedClass() { |
| 175 Source source = addSource(r''' | 162 Source source = addSource(r''' |
| 176 @deprecated | 163 @deprecated |
| 177 f() {} | 164 f() {} |
| 178 | 165 |
| 179 @deprecated | 166 @deprecated |
| 180 class C { | 167 class C { |
| 181 m() { | 168 m() { |
| 182 f(); | 169 f(); |
| 183 } | 170 } |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 | 1226 |
| 1240 void test_import_valid_outside_lib() { | 1227 void test_import_valid_outside_lib() { |
| 1241 cacheSource("/myproj/pubspec.yaml", ""); | 1228 cacheSource("/myproj/pubspec.yaml", ""); |
| 1242 cacheSource("/myproj/web/other.dart", ""); | 1229 cacheSource("/myproj/web/other.dart", ""); |
| 1243 Source source = | 1230 Source source = |
| 1244 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); | 1231 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); |
| 1245 computeLibrarySourceErrors(source); | 1232 computeLibrarySourceErrors(source); |
| 1246 assertNoErrors(source); | 1233 assertNoErrors(source); |
| 1247 } | 1234 } |
| 1248 } | 1235 } |
| OLD | NEW |