| 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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 ''', | 878 ''', |
| 879 priority: true); | 879 priority: true); |
| 880 | 880 |
| 881 AnalysisResult result = await driver.getResult(testFile); | 881 AnalysisResult result = await driver.getResult(testFile); |
| 882 ClassDeclaration c = result.unit.declarations[1] as ClassDeclaration; | 882 ClassDeclaration c = result.unit.declarations[1] as ClassDeclaration; |
| 883 Annotation a = c.metadata[0]; | 883 Annotation a = c.metadata[0]; |
| 884 expect(a.name.name, 'fff'); | 884 expect(a.name.name, 'fff'); |
| 885 expect(a.name.staticElement, new isInstanceOf<FunctionElement>()); | 885 expect(a.name.staticElement, new isInstanceOf<FunctionElement>()); |
| 886 } | 886 } |
| 887 | 887 |
| 888 test_getResult_invalidUri() async { | |
| 889 String content = r''' | |
| 890 import 'package:aaa/a1.dart'; | |
| 891 import '[invalid uri]'; | |
| 892 | |
| 893 export '[invalid uri]'; | |
| 894 export 'package:aaa/a2.dart'; | |
| 895 | |
| 896 part 'a3.dart'; | |
| 897 part '[invalid uri]'; | |
| 898 '''; | |
| 899 addTestFile(content); | |
| 900 | |
| 901 AnalysisResult result = await driver.getResult(testFile); | |
| 902 expect(result.path, testFile); | |
| 903 } | |
| 904 | |
| 905 test_getResult_invalidUri_exports_dart() async { | 888 test_getResult_invalidUri_exports_dart() async { |
| 906 String content = r''' | 889 String content = r''' |
| 907 export 'dart:async'; | 890 export 'dart:async'; |
| 908 export 'dart:noSuchLib'; | 891 export 'dart:noSuchLib'; |
| 909 export 'dart:math'; | 892 export 'dart:math'; |
| 910 '''; | 893 '''; |
| 911 addTestFile(content, priority: true); | 894 addTestFile(content, priority: true); |
| 912 | 895 |
| 913 AnalysisResult result = await driver.getResult(testFile); | 896 AnalysisResult result = await driver.getResult(testFile); |
| 914 expect(result.path, testFile); | 897 expect(result.path, testFile); |
| (...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 * Return the [provider] specific path for the given Posix [path]. | 1991 * Return the [provider] specific path for the given Posix [path]. |
| 2009 */ | 1992 */ |
| 2010 String _p(String path) => provider.convertPath(path); | 1993 String _p(String path) => provider.convertPath(path); |
| 2011 | 1994 |
| 2012 static String _md5(String content) { | 1995 static String _md5(String content) { |
| 2013 return hex.encode(md5.convert(UTF8.encode(content)).bytes); | 1996 return hex.encode(md5.convert(UTF8.encode(content)).bytes); |
| 2014 } | 1997 } |
| 2015 } | 1998 } |
| 2016 | 1999 |
| 2017 class _SourceMock extends TypedMock implements Source {} | 2000 class _SourceMock extends TypedMock implements Source {} |
| OLD | NEW |