| 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 4146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4157 expect(relative.toString(), "dart:test/lib.dart"); | 4157 expect(relative.toString(), "dart:test/lib.dart"); |
| 4158 } | 4158 } |
| 4159 | 4159 |
| 4160 void test_resolveRelative_dart_filePath() { | 4160 void test_resolveRelative_dart_filePath() { |
| 4161 Uri uri = parseUriWithException("dart:test"); | 4161 Uri uri = parseUriWithException("dart:test"); |
| 4162 Uri relative = resolveRelativeUri(uri, parseUriWithException("c/lib.dart")); | 4162 Uri relative = resolveRelativeUri(uri, parseUriWithException("c/lib.dart")); |
| 4163 expect(relative, isNotNull); | 4163 expect(relative, isNotNull); |
| 4164 expect(relative.toString(), "dart:test/c/lib.dart"); | 4164 expect(relative.toString(), "dart:test/c/lib.dart"); |
| 4165 } | 4165 } |
| 4166 | 4166 |
| 4167 void test_resolveRelative_dart_dartUri() { |
| 4168 Uri uri = parseUriWithException('dart:foo'); |
| 4169 Uri relative = resolveRelativeUri(uri, parseUriWithException('dart:bar')); |
| 4170 expect(relative, isNotNull); |
| 4171 expect(relative.toString(), 'dart:bar'); |
| 4172 } |
| 4173 |
| 4167 void test_resolveRelative_dart_filePathWithParent() { | 4174 void test_resolveRelative_dart_filePathWithParent() { |
| 4168 Uri uri = parseUriWithException("dart:test/b/test.dart"); | 4175 Uri uri = parseUriWithException("dart:test/b/test.dart"); |
| 4169 Uri relative = | 4176 Uri relative = |
| 4170 resolveRelativeUri(uri, parseUriWithException("../c/lib.dart")); | 4177 resolveRelativeUri(uri, parseUriWithException("../c/lib.dart")); |
| 4171 expect(relative, isNotNull); | 4178 expect(relative, isNotNull); |
| 4172 expect(relative.toString(), "dart:test/c/lib.dart"); | 4179 expect(relative.toString(), "dart:test/c/lib.dart"); |
| 4173 } | 4180 } |
| 4174 | 4181 |
| 4175 void test_resolveRelative_package_fileName() { | 4182 void test_resolveRelative_package_fileName() { |
| 4176 Uri uri = parseUriWithException("package:b/test.dart"); | 4183 Uri uri = parseUriWithException("package:b/test.dart"); |
| 4177 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); | 4184 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); |
| 4178 expect(relative, isNotNull); | 4185 expect(relative, isNotNull); |
| 4179 expect(relative.toString(), "package:b/lib.dart"); | 4186 expect(relative.toString(), "package:b/lib.dart"); |
| 4180 } | 4187 } |
| 4181 | 4188 |
| 4182 void test_resolveRelative_package_fileNameWithoutPackageName() { | 4189 void test_resolveRelative_package_fileNameWithoutPackageName() { |
| 4183 Uri uri = parseUriWithException("package:test.dart"); | 4190 Uri uri = parseUriWithException("package:test.dart"); |
| 4184 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); | 4191 Uri relative = resolveRelativeUri(uri, parseUriWithException("lib.dart")); |
| 4185 expect(relative, isNotNull); | 4192 expect(relative, isNotNull); |
| 4186 expect(relative.toString(), "package:lib.dart"); | 4193 expect(relative.toString(), "package:lib.dart"); |
| 4187 } | 4194 } |
| 4188 | 4195 |
| 4196 void test_resolveRelative_package_dartUri() { |
| 4197 Uri uri = parseUriWithException('package:foo/bar.dart'); |
| 4198 Uri relative = resolveRelativeUri(uri, parseUriWithException('dart:test')); |
| 4199 expect(relative, isNotNull); |
| 4200 expect(relative.toString(), 'dart:test'); |
| 4201 } |
| 4202 |
| 4189 void test_resolveRelative_package_filePath() { | 4203 void test_resolveRelative_package_filePath() { |
| 4190 Uri uri = parseUriWithException("package:b/test.dart"); | 4204 Uri uri = parseUriWithException("package:b/test.dart"); |
| 4191 Uri relative = resolveRelativeUri(uri, parseUriWithException("c/lib.dart")); | 4205 Uri relative = resolveRelativeUri(uri, parseUriWithException("c/lib.dart")); |
| 4192 expect(relative, isNotNull); | 4206 expect(relative, isNotNull); |
| 4193 expect(relative.toString(), "package:b/c/lib.dart"); | 4207 expect(relative.toString(), "package:b/c/lib.dart"); |
| 4194 } | 4208 } |
| 4195 | 4209 |
| 4196 void test_resolveRelative_package_filePathWithParent() { | 4210 void test_resolveRelative_package_filePathWithParent() { |
| 4197 Uri uri = parseUriWithException("package:a/b/test.dart"); | 4211 Uri uri = parseUriWithException("package:a/b/test.dart"); |
| 4198 Uri relative = | 4212 Uri relative = |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4285 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); | 4299 expect(UriKind.fromEncoding(0x70), same(UriKind.PACKAGE_URI)); |
| 4286 expect(UriKind.fromEncoding(0x58), same(null)); | 4300 expect(UriKind.fromEncoding(0x58), same(null)); |
| 4287 } | 4301 } |
| 4288 | 4302 |
| 4289 void test_getEncoding() { | 4303 void test_getEncoding() { |
| 4290 expect(UriKind.DART_URI.encoding, 0x64); | 4304 expect(UriKind.DART_URI.encoding, 0x64); |
| 4291 expect(UriKind.FILE_URI.encoding, 0x66); | 4305 expect(UriKind.FILE_URI.encoding, 0x66); |
| 4292 expect(UriKind.PACKAGE_URI.encoding, 0x70); | 4306 expect(UriKind.PACKAGE_URI.encoding, 0x70); |
| 4293 } | 4307 } |
| 4294 } | 4308 } |
| OLD | NEW |