Chromium Code Reviews| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 if (1 < 0) { | 183 if (1 < 0) { |
| 184 return; | 184 return; |
| 185 } | 185 } |
| 186 int a = 1; | 186 int a = 1; |
| 187 }'''); | 187 }'''); |
| 188 computeLibrarySourceErrors(source); | 188 computeLibrarySourceErrors(source); |
| 189 assertNoErrors(source); | 189 assertNoErrors(source); |
| 190 verify([source]); | 190 verify([source]); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void test_deadCode_deadFinalBreakInCase() { | |
| 194 Source source = addSource(r''' | |
| 195 f() { | |
| 196 switch (true) { | |
| 197 case true: | |
| 198 try { | |
| 199 int a = 1; | |
| 200 } finally { | |
| 201 return; | |
| 202 } | |
| 203 break; | |
|
Paul Berry
2016/06/14 18:39:27
Please also add tests for the other kind of statem
srawlins
2016/06/14 21:09:55
Acknowledged.
| |
| 204 default: | |
| 205 break; | |
| 206 } | |
| 207 }'''); | |
| 208 computeLibrarySourceErrors(source); | |
| 209 assertNoErrors(source); | |
| 210 verify([source]); | |
| 211 } | |
| 212 | |
| 193 void test_deprecatedMemberUse_inDeprecatedClass() { | 213 void test_deprecatedMemberUse_inDeprecatedClass() { |
| 194 Source source = addSource(r''' | 214 Source source = addSource(r''' |
| 195 @deprecated | 215 @deprecated |
| 196 f() {} | 216 f() {} |
| 197 | 217 |
| 198 @deprecated | 218 @deprecated |
| 199 class C { | 219 class C { |
| 200 m() { | 220 m() { |
| 201 f(); | 221 f(); |
| 202 } | 222 } |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1258 | 1278 |
| 1259 void test_import_valid_outside_lib() { | 1279 void test_import_valid_outside_lib() { |
| 1260 cacheSource("/myproj/pubspec.yaml", ""); | 1280 cacheSource("/myproj/pubspec.yaml", ""); |
| 1261 cacheSource("/myproj/web/other.dart", ""); | 1281 cacheSource("/myproj/web/other.dart", ""); |
| 1262 Source source = | 1282 Source source = |
| 1263 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); | 1283 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); |
| 1264 computeLibrarySourceErrors(source); | 1284 computeLibrarySourceErrors(source); |
| 1265 assertNoErrors(source); | 1285 assertNoErrors(source); |
| 1266 } | 1286 } |
| 1267 } | 1287 } |
| OLD | NEW |