OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.incremental_resolver_test; | 5 library analyzer.test.generated.incremental_resolver_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/src/context/cache.dart'; | 10 import 'package:analyzer/src/context/cache.dart'; |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 '''); | 1341 '''); |
1342 _updateAndValidate(r''' | 1342 _updateAndValidate(r''' |
1343 class A { | 1343 class A { |
1344 a() {} | 1344 a() {} |
1345 | 1345 |
1346 b() {} | 1346 b() {} |
1347 } | 1347 } |
1348 '''); | 1348 '''); |
1349 } | 1349 } |
1350 | 1350 |
| 1351 void test_true_emptyLine_betweenClassMembers_insert_beforeComment() { |
| 1352 _resolveUnit(r''' |
| 1353 class A { |
| 1354 a() {} |
| 1355 /// BBB |
| 1356 b() {} |
| 1357 } |
| 1358 '''); |
| 1359 _updateAndValidate(r''' |
| 1360 class A { |
| 1361 a() {} |
| 1362 |
| 1363 /// BBB |
| 1364 b() {} |
| 1365 } |
| 1366 '''); |
| 1367 } |
| 1368 |
1351 void test_true_emptyLine_betweenClassMembers_remove() { | 1369 void test_true_emptyLine_betweenClassMembers_remove() { |
1352 _resolveUnit(r''' | 1370 _resolveUnit(r''' |
1353 class A { | 1371 class A { |
1354 a() {} | 1372 a() {} |
1355 | 1373 |
1356 b() {} | 1374 b() {} |
1357 } | 1375 } |
1358 '''); | 1376 '''); |
1359 _updateAndValidate(r''' | 1377 _updateAndValidate(r''' |
1360 class A { | 1378 class A { |
1361 a() {} | 1379 a() {} |
1362 b() {} | 1380 b() {} |
1363 } | 1381 } |
1364 '''); | 1382 '''); |
1365 } | 1383 } |
1366 | 1384 |
1367 void test_true_emptyLine_betweenCompilationUnitMembers_insert() { | 1385 void test_true_emptyLine_betweenClassMembers_remove_beforeComment() { |
| 1386 _resolveUnit(r''' |
| 1387 class A { |
| 1388 a() {} |
| 1389 |
| 1390 /// BBB |
| 1391 b() {} |
| 1392 } |
| 1393 '''); |
| 1394 _updateAndValidate(r''' |
| 1395 class A { |
| 1396 a() {} |
| 1397 /// BBB |
| 1398 b() {} |
| 1399 } |
| 1400 '''); |
| 1401 } |
| 1402 |
| 1403 void test_true_emptyLine_betweenUnitMembers_insert() { |
1368 _resolveUnit(r''' | 1404 _resolveUnit(r''' |
1369 a() {} | 1405 a() {} |
1370 b() {} | 1406 b() {} |
1371 '''); | 1407 '''); |
1372 _updateAndValidate(r''' | 1408 _updateAndValidate(r''' |
1373 a() {} | 1409 a() {} |
1374 | 1410 |
1375 b() {} | 1411 b() {} |
1376 '''); | 1412 '''); |
1377 } | 1413 } |
1378 | 1414 |
1379 void test_true_emptyLine_betweenCompilationUnitMembers_remove() { | 1415 void test_true_emptyLine_betweenUnitMembers_insert_beforeComment() { |
| 1416 _resolveUnit(r''' |
| 1417 a() {} |
| 1418 |
| 1419 // BBB |
| 1420 b() {} |
| 1421 '''); |
| 1422 _updateAndValidate(r''' |
| 1423 a() {} |
| 1424 |
| 1425 |
| 1426 // BBB |
| 1427 b() {} |
| 1428 '''); |
| 1429 } |
| 1430 |
| 1431 void test_true_emptyLine_betweenUnitMembers_remove() { |
1380 _resolveUnit(r''' | 1432 _resolveUnit(r''' |
1381 a() { | 1433 a() { |
1382 print(1) | 1434 print(1) |
1383 } | 1435 } |
1384 | 1436 |
1385 b() { | 1437 b() { |
1386 foo(42); | 1438 foo(42); |
1387 } | 1439 } |
1388 foo(String p) {} | 1440 foo(String p) {} |
1389 '''); | 1441 '''); |
1390 _updateAndValidate(r''' | 1442 _updateAndValidate(r''' |
1391 a() { | 1443 a() { |
1392 print(1) | 1444 print(1) |
1393 } | 1445 } |
1394 b() { | 1446 b() { |
1395 foo(42); | 1447 foo(42); |
1396 } | 1448 } |
1397 foo(String p) {} | 1449 foo(String p) {} |
1398 '''); | 1450 '''); |
1399 } | 1451 } |
1400 | 1452 |
| 1453 void test_true_emptyLine_betweenUnitMembers_remove_beforeComment() { |
| 1454 _resolveUnit(r''' |
| 1455 a() {} |
| 1456 |
| 1457 // BBB |
| 1458 b() {} |
| 1459 '''); |
| 1460 _updateAndValidate(r''' |
| 1461 a() {} |
| 1462 // BBB |
| 1463 b() {} |
| 1464 '''); |
| 1465 } |
| 1466 |
1401 void test_true_todoHint() { | 1467 void test_true_todoHint() { |
1402 _resolveUnit(r''' | 1468 _resolveUnit(r''' |
1403 main() { | 1469 main() { |
1404 print(1); | 1470 print(1); |
1405 } | 1471 } |
1406 foo() { | 1472 foo() { |
1407 // TODO | 1473 // TODO |
1408 } | 1474 } |
1409 '''); | 1475 '''); |
1410 List<AnalysisError> oldErrors = analysisContext.computeErrors(source); | 1476 List<AnalysisError> oldErrors = analysisContext.computeErrors(source); |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2268 void logException(Object exception, [Object stackTrace]) { | 2334 void logException(Object exception, [Object stackTrace]) { |
2269 lastException = exception; | 2335 lastException = exception; |
2270 lastStackTrace = stackTrace; | 2336 lastStackTrace = stackTrace; |
2271 } | 2337 } |
2272 | 2338 |
2273 @override | 2339 @override |
2274 logging.LoggingTimer startTimer() { | 2340 logging.LoggingTimer startTimer() { |
2275 return new logging.LoggingTimer(this); | 2341 return new logging.LoggingTimer(this); |
2276 } | 2342 } |
2277 } | 2343 } |
OLD | NEW |