| 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.driver; | 5 library analyzer.test.driver; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 } | 646 } |
| 647 ''', | 647 ''', |
| 648 priority: true); | 648 priority: true); |
| 649 await _waitForIdle(); | 649 await _waitForIdle(); |
| 650 | 650 |
| 651 AnalysisResult result = await driver.getResult(testFile); | 651 AnalysisResult result = await driver.getResult(testFile); |
| 652 expect(_getClassMethodReturnType(result.unit, 'A', 'm'), 'int'); | 652 expect(_getClassMethodReturnType(result.unit, 'A', 'm'), 'int'); |
| 653 expect(_getClassMethodReturnType(result.unit, 'B', 'm'), 'int'); | 653 expect(_getClassMethodReturnType(result.unit, 'B', 'm'), 'int'); |
| 654 } | 654 } |
| 655 | 655 |
| 656 test_getResult_invalid_annotation_functionAsConstructor() async { |
| 657 addTestFile( |
| 658 r''' |
| 659 fff() {} |
| 660 |
| 661 @fff() |
| 662 class C {} |
| 663 ''', |
| 664 priority: true); |
| 665 |
| 666 AnalysisResult result = await driver.getResult(testFile); |
| 667 ClassDeclaration c = result.unit.declarations[1] as ClassDeclaration; |
| 668 Annotation a = c.metadata[0]; |
| 669 expect(a.name.name, 'fff'); |
| 670 expect(a.name.staticElement, new isInstanceOf<FunctionElement>()); |
| 671 } |
| 672 |
| 656 test_getResult_invalidUri_exports_dart() async { | 673 test_getResult_invalidUri_exports_dart() async { |
| 657 String content = r''' | 674 String content = r''' |
| 658 export 'dart:async'; | 675 export 'dart:async'; |
| 659 export 'dart:noSuchLib'; | 676 export 'dart:noSuchLib'; |
| 660 export 'dart:math'; | 677 export 'dart:math'; |
| 661 '''; | 678 '''; |
| 662 addTestFile(content, priority: true); | 679 addTestFile(content, priority: true); |
| 663 | 680 |
| 664 AnalysisResult result = await driver.getResult(testFile); | 681 AnalysisResult result = await driver.getResult(testFile); |
| 665 expect(result.path, testFile); | 682 expect(result.path, testFile); |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 String _p(String path) => provider.convertPath(path); | 1580 String _p(String path) => provider.convertPath(path); |
| 1564 | 1581 |
| 1565 Future<Null> _waitForIdle() async { | 1582 Future<Null> _waitForIdle() async { |
| 1566 await idleStatusMonitor.signal; | 1583 await idleStatusMonitor.signal; |
| 1567 } | 1584 } |
| 1568 | 1585 |
| 1569 static String _md5(String content) { | 1586 static String _md5(String content) { |
| 1570 return hex.encode(md5.convert(UTF8.encode(content)).bytes); | 1587 return hex.encode(md5.convert(UTF8.encode(content)).bytes); |
| 1571 } | 1588 } |
| 1572 } | 1589 } |
| OLD | NEW |