| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.task.dart_test; | 5 library test.src.task.dart_test; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart'; | 8 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 | 1431 |
| 1432 void _performScanTask(String content) { | 1432 void _performScanTask(String content) { |
| 1433 AnalysisTarget target = _newSource('/test.dart', content); | 1433 AnalysisTarget target = _newSource('/test.dart', content); |
| 1434 _computeResult(target, TOKEN_STREAM); | 1434 _computeResult(target, TOKEN_STREAM); |
| 1435 expect(task, new isInstanceOf<ScanDartTask>()); | 1435 expect(task, new isInstanceOf<ScanDartTask>()); |
| 1436 } | 1436 } |
| 1437 } | 1437 } |
| 1438 | 1438 |
| 1439 @reflectiveTest | 1439 @reflectiveTest |
| 1440 class VerifyUnitTaskTest extends _AbstractDartTaskTest { | 1440 class VerifyUnitTaskTest extends _AbstractDartTaskTest { |
| 1441 test_perform_directiveError() { | |
| 1442 // TODO(scheglov) uncomment when GetContentTask handles not | |
| 1443 // existing sources correctly. | |
| 1444 // Source source = _newSource('/test.dart', ''' | |
| 1445 //library lib; | |
| 1446 //part '/does/not/exist.dart'; | |
| 1447 //'''); | |
| 1448 // LibraryUnitTarget target = new LibraryUnitTarget(source, source); | |
| 1449 // _computeResult(target, VERIFY_ERRORS); | |
| 1450 // expect(task, new isInstanceOf<VerifyUnitTask>()); | |
| 1451 // // validate | |
| 1452 // _fillErrorListener(VERIFY_ERRORS); | |
| 1453 // errorListener.assertErrorsWithCodes( | |
| 1454 // <ErrorCode>[StaticTypeWarningCode.NON_BOOL_CONDITION]); | |
| 1455 } | |
| 1456 | |
| 1457 test_perform_verifyError() { | 1441 test_perform_verifyError() { |
| 1458 Source source = _newSource('/test.dart', ''' | 1442 Source source = _newSource('/test.dart', ''' |
| 1459 main() { | 1443 main() { |
| 1460 if (42) { | 1444 if (42) { |
| 1461 print('Not bool!'); | 1445 print('Not bool!'); |
| 1462 } | 1446 } |
| 1463 } | 1447 } |
| 1464 '''); | 1448 '''); |
| 1465 LibraryUnitTarget target = new LibraryUnitTarget(source, source); | 1449 LibraryUnitTarget target = new LibraryUnitTarget(source, source); |
| 1466 _computeResult(target, VERIFY_ERRORS); | 1450 _computeResult(target, VERIFY_ERRORS); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1570 return entryMap.putIfAbsent(target, () => new CacheEntry()); | 1554 return entryMap.putIfAbsent(target, () => new CacheEntry()); |
| 1571 } | 1555 } |
| 1572 | 1556 |
| 1573 TimestampedData<String> getContents(Source source) => source.contents; | 1557 TimestampedData<String> getContents(Source source) => source.contents; |
| 1574 | 1558 |
| 1575 noSuchMethod(Invocation invocation) { | 1559 noSuchMethod(Invocation invocation) { |
| 1576 print('noSuchMethod: ${invocation.memberName}'); | 1560 print('noSuchMethod: ${invocation.memberName}'); |
| 1577 return super.noSuchMethod(invocation); | 1561 return super.noSuchMethod(invocation); |
| 1578 } | 1562 } |
| 1579 } | 1563 } |
| OLD | NEW |