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 engine.all_the_rest_test; | 5 library engine.all_the_rest_test; |
6 | 6 |
7 import 'package:analyzer/file_system/physical_file_system.dart'; | 7 import 'package:analyzer/file_system/physical_file_system.dart'; |
8 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; | 8 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; |
9 import 'package:analyzer/src/generated/constant.dart'; | 9 import 'package:analyzer/src/generated/constant.dart'; |
10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
(...skipping 7953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7964 expect(result.fullName, | 7964 expect(result.fullName, |
7965 FileUtilities2.createFile("/does/not/exist.dart").getAbsolutePath()); | 7965 FileUtilities2.createFile("/does/not/exist.dart").getAbsolutePath()); |
7966 } | 7966 } |
7967 | 7967 |
7968 void test_resolve_nonFile() { | 7968 void test_resolve_nonFile() { |
7969 UriResolver resolver = new FileUriResolver(); | 7969 UriResolver resolver = new FileUriResolver(); |
7970 Source result = | 7970 Source result = |
7971 resolver.resolveAbsolute(parseUriWithException("dart:core")); | 7971 resolver.resolveAbsolute(parseUriWithException("dart:core")); |
7972 expect(result, isNull); | 7972 expect(result, isNull); |
7973 } | 7973 } |
| 7974 |
| 7975 void test_restore() { |
| 7976 UriResolver resolver = new FileUriResolver(); |
| 7977 Uri uri = parseUriWithException('file:///foo/bar.dart'); |
| 7978 Source source = resolver.resolveAbsolute(uri); |
| 7979 expect(source, isNotNull); |
| 7980 expect(resolver.restoreAbsolute(source), uri); |
| 7981 expect( |
| 7982 resolver.restoreAbsolute( |
| 7983 new NonExistingSource(source.fullName, null, null)), |
| 7984 uri); |
| 7985 } |
7974 } | 7986 } |
7975 | 7987 |
7976 @reflectiveTest | 7988 @reflectiveTest |
7977 class HtmlParserTest extends EngineTestCase { | 7989 class HtmlParserTest extends EngineTestCase { |
7978 /** | 7990 /** |
7979 * The name of the 'script' tag in an HTML file. | 7991 * The name of the 'script' tag in an HTML file. |
7980 */ | 7992 */ |
7981 static String _TAG_SCRIPT = "script"; | 7993 static String _TAG_SCRIPT = "script"; |
7982 void fail_parse_scriptWithComment() { | 7994 void fail_parse_scriptWithComment() { |
7983 String scriptBody = r''' | 7995 String scriptBody = r''' |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8986 if (_expectedExternalScriptName == null) { | 8998 if (_expectedExternalScriptName == null) { |
8987 expect(scriptSource, isNull, reason: "script $scriptIndex"); | 8999 expect(scriptSource, isNull, reason: "script $scriptIndex"); |
8988 } else { | 9000 } else { |
8989 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); | 9001 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); |
8990 String actualExternalScriptName = scriptSource.shortName; | 9002 String actualExternalScriptName = scriptSource.shortName; |
8991 expect(actualExternalScriptName, _expectedExternalScriptName, | 9003 expect(actualExternalScriptName, _expectedExternalScriptName, |
8992 reason: "script $scriptIndex"); | 9004 reason: "script $scriptIndex"); |
8993 } | 9005 } |
8994 } | 9006 } |
8995 } | 9007 } |
OLD | NEW |