| 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.all_the_rest_test; | 5 library analyzer.test.generated.all_the_rest_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/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 4137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4148 expect(resolver.restoreAbsolute(source), uri); | 4148 expect(resolver.restoreAbsolute(source), uri); |
| 4149 expect( | 4149 expect( |
| 4150 resolver.restoreAbsolute( | 4150 resolver.restoreAbsolute( |
| 4151 new NonExistingSource(source.fullName, null, null)), | 4151 new NonExistingSource(source.fullName, null, null)), |
| 4152 uri); | 4152 uri); |
| 4153 } | 4153 } |
| 4154 } | 4154 } |
| 4155 | 4155 |
| 4156 @reflectiveTest | 4156 @reflectiveTest |
| 4157 class ResolveRelativeUriTest { | 4157 class ResolveRelativeUriTest { |
| 4158 void test_resolveRelative_dart_dartUri() { |
| 4159 Uri uri = parseUriWithException('dart:foo'); |
| 4160 Uri relative = resolveRelativeUri(uri, parseUriWithException('dart:bar')); |
| 4161 expect(relative, isNotNull); |
| 4162 expect(relative.toString(), 'dart:bar'); |
| 4163 } |
| 4164 |
| 4158 void test_resolveRelative_dart_fileName() { | 4165 void test_resolveRelative_dart_fileName() { |
| 4159 Uri uri = parseUriWithException("dart:test"); | 4166 Uri uri = parseUriWithException("dart:test"); |
| 4160 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); | 4167 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); |
| 4161 expect(relative, isNotNull); | 4168 expect(relative, isNotNull); |
| 4162 expect(relative.toString(), "dart:test/lib.dart"); | 4169 expect(relative.toString(), "dart:test/lib.dart"); |
| 4163 } | 4170 } |
| 4164 | 4171 |
| 4165 void test_resolveRelative_dart_filePath() { | 4172 void test_resolveRelative_dart_filePath() { |
| 4166 Uri uri = parseUriWithException("dart:test"); | 4173 Uri uri = parseUriWithException("dart:test"); |
| 4167 Uri relative = resolveRelativeUri(uri, parseUriWithException("c/lib.dart")); | 4174 Uri relative = resolveRelativeUri(uri, parseUriWithException("c/lib.dart")); |
| 4168 expect(relative, isNotNull); | 4175 expect(relative, isNotNull); |
| 4169 expect(relative.toString(), "dart:test/c/lib.dart"); | 4176 expect(relative.toString(), "dart:test/c/lib.dart"); |
| 4170 } | 4177 } |
| 4171 | 4178 |
| 4172 void test_resolveRelative_dart_dartUri() { | |
| 4173 Uri uri = parseUriWithException('dart:foo'); | |
| 4174 Uri relative = resolveRelativeUri(uri, parseUriWithException('dart:bar')); | |
| 4175 expect(relative, isNotNull); | |
| 4176 expect(relative.toString(), 'dart:bar'); | |
| 4177 } | |
| 4178 | |
| 4179 void test_resolveRelative_dart_filePathWithParent() { | 4179 void test_resolveRelative_dart_filePathWithParent() { |
| 4180 Uri uri = parseUriWithException("dart:test/b/test.dart"); | 4180 Uri uri = parseUriWithException("dart:test/b/test.dart"); |
| 4181 Uri relative = | 4181 Uri relative = |
| 4182 resolveRelativeUri(uri, parseUriWithException("../c/lib.dart")); | 4182 resolveRelativeUri(uri, parseUriWithException("../c/lib.dart")); |
| 4183 expect(relative, isNotNull); | 4183 expect(relative, isNotNull); |
| 4184 expect(relative.toString(), "dart:test/c/lib.dart"); | 4184 expect(relative.toString(), "dart:test/c/lib.dart"); |
| 4185 } | 4185 } |
| 4186 | 4186 |
| 4187 void test_resolveRelative_package_dartUri() { |
| 4188 Uri uri = parseUriWithException('package:foo/bar.dart'); |
| 4189 Uri relative = resolveRelativeUri(uri, parseUriWithException('dart:test')); |
| 4190 expect(relative, isNotNull); |
| 4191 expect(relative.toString(), 'dart:test'); |
| 4192 } |
| 4193 |
| 4187 void test_resolveRelative_package_fileName() { | 4194 void test_resolveRelative_package_fileName() { |
| 4188 Uri uri = parseUriWithException("package:b/test.dart"); | 4195 Uri uri = parseUriWithException("package:b/test.dart"); |
| 4189 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); | 4196 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); |
| 4190 expect(relative, isNotNull); | 4197 expect(relative, isNotNull); |
| 4191 expect(relative.toString(), "package:b/lib.dart"); | 4198 expect(relative.toString(), "package:b/lib.dart"); |
| 4192 } | 4199 } |
| 4193 | 4200 |
| 4194 void test_resolveRelative_package_fileNameWithoutPackageName() { | 4201 void test_resolveRelative_package_fileNameWithoutPackageName() { |
| 4195 Uri uri = parseUriWithException("package:test.dart"); | 4202 Uri uri = parseUriWithException("package:test.dart"); |
| 4196 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); | 4203 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); |
| 4197 expect(relative, isNotNull); | 4204 expect(relative, isNotNull); |
| 4198 expect(relative.toString(), "package:lib.dart"); | 4205 expect(relative.toString(), "package:lib.dart"); |
| 4199 } | 4206 } |
| 4200 | 4207 |
| 4201 void test_resolveRelative_package_dartUri() { | |
| 4202 Uri uri = parseUriWithException('package:foo/bar.dart'); | |
| 4203 Uri relative = resolveRelativeUri(uri, parseUriWithException('dart:test')); | |
| 4204 expect(relative, isNotNull); | |
| 4205 expect(relative.toString(), 'dart:test'); | |
| 4206 } | |
| 4207 | |
| 4208 void test_resolveRelative_package_filePath() { | 4208 void test_resolveRelative_package_filePath() { |
| 4209 Uri uri = parseUriWithException("package:b/test.dart"); | 4209 Uri uri = parseUriWithException("package:b/test.dart"); |
| 4210 Uri relative = resolveRelativeUri(uri, parseUriWithException("c/lib.dart")); | 4210 Uri relative = resolveRelativeUri(uri, parseUriWithException("c/lib.dart")); |
| 4211 expect(relative, isNotNull); | 4211 expect(relative, isNotNull); |
| 4212 expect(relative.toString(), "package:b/c/lib.dart"); | 4212 expect(relative.toString(), "package:b/c/lib.dart"); |
| 4213 } | 4213 } |
| 4214 | 4214 |
| 4215 void test_resolveRelative_package_filePathWithParent() { | 4215 void test_resolveRelative_package_filePathWithParent() { |
| 4216 Uri uri = parseUriWithException("package:a/b/test.dart"); | 4216 Uri uri = parseUriWithException("package:a/b/test.dart"); |
| 4217 Uri relative = | 4217 Uri relative = |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4304 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); | 4304 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); |
| 4305 expect(UriKind.fromEncoding(0x58), same(null)); | 4305 expect(UriKind.fromEncoding(0x58), same(null)); |
| 4306 } | 4306 } |
| 4307 | 4307 |
| 4308 void test_getEncoding() { | 4308 void test_getEncoding() { |
| 4309 expect(UriKind.DART_URI.encoding, 0x64); | 4309 expect(UriKind.DART_URI.encoding, 0x64); |
| 4310 expect(UriKind.FILE_URI.encoding, 0x66); | 4310 expect(UriKind.FILE_URI.encoding, 0x66); |
| 4311 expect(UriKind.PACKAGE_URI.encoding, 0x70); | 4311 expect(UriKind.PACKAGE_URI.encoding, 0x70); |
| 4312 } | 4312 } |
| 4313 } | 4313 } |
| OLD | NEW |