| 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 test.services.completion.contributor.dart.importuri; | 5 library test.services.completion.contributor.dart.importuri; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 8 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 9 import 'package:analysis_server/src/services/completion/uri_contributor.dart'; | 9 import 'package:analysis_server/src/services/completion/uri_contributor.dart'; |
| 10 import 'package:analyzer/file_system/memory_file_system.dart'; | 10 import 'package:analyzer/file_system/memory_file_system.dart'; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 test_import_package2() { | 179 test_import_package2() { |
| 180 addPackageSource('foo', 'foo.dart', 'library foo;'); | 180 addPackageSource('foo', 'foo.dart', 'library foo;'); |
| 181 addPackageSource('foo', 'baz/too.dart', 'library too;'); | 181 addPackageSource('foo', 'baz/too.dart', 'library too;'); |
| 182 addPackageSource('bar', 'bar.dart', 'library bar;'); | 182 addPackageSource('bar', 'bar.dart', 'library bar;'); |
| 183 addTestSource('import "package:foo/baz/^" import'); | 183 addTestSource('import "package:foo/baz/^" import'); |
| 184 computeFast(); | 184 computeFast(); |
| 185 assertSuggest('package:foo/baz/too.dart', | 185 assertSuggest('package:foo/baz/too.dart', |
| 186 csKind: CompletionSuggestionKind.IMPORT); | 186 csKind: CompletionSuggestionKind.IMPORT); |
| 187 } | 187 } |
| 188 | 188 |
| 189 test_export_package2() { |
| 190 addPackageSource('foo', 'foo.dart', 'library foo;'); |
| 191 addPackageSource('foo', 'baz/too.dart', 'library too;'); |
| 192 addPackageSource('bar', 'bar.dart', 'library bar;'); |
| 193 addTestSource('export "package:foo/baz/^" import'); |
| 194 computeFast(); |
| 195 assertSuggest('package:foo/baz/too.dart', |
| 196 csKind: CompletionSuggestionKind.IMPORT); |
| 197 } |
| 198 |
| 189 test_import_package_missing_lib() { | 199 test_import_package_missing_lib() { |
| 190 var pkgSrc = addPackageSource('bar', 'bar.dart', 'library bar;'); | 200 var pkgSrc = addPackageSource('bar', 'bar.dart', 'library bar;'); |
| 191 provider.deleteFolder(dirname(pkgSrc.fullName)); | 201 provider.deleteFolder(dirname(pkgSrc.fullName)); |
| 192 addTestSource('import "p^" class'); | 202 addTestSource('import "p^" class'); |
| 193 computeFast(); | 203 computeFast(); |
| 194 expect(request.replacementOffset, completionOffset - 1); | 204 expect(request.replacementOffset, completionOffset - 1); |
| 195 expect(request.replacementLength, 1); | 205 expect(request.replacementLength, 1); |
| 196 assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT); | 206 assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT); |
| 197 assertSuggest('package:bar/', csKind: CompletionSuggestionKind.IMPORT); | 207 assertSuggest('package:bar/', csKind: CompletionSuggestionKind.IMPORT); |
| 198 assertNotSuggested('package:bar/bar.dart'); | 208 assertNotSuggested('package:bar/bar.dart'); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 assertNotSuggested('foo/'); | 456 assertNotSuggested('foo/'); |
| 447 assertNotSuggested('foo/bar.dart'); | 457 assertNotSuggested('foo/bar.dart'); |
| 448 assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT); | 458 assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT); |
| 449 } | 459 } |
| 450 } | 460 } |
| 451 | 461 |
| 452 class _TestWinResourceProvider extends MemoryResourceProvider { | 462 class _TestWinResourceProvider extends MemoryResourceProvider { |
| 453 @override | 463 @override |
| 454 Context get pathContext => windows; | 464 Context get pathContext => windows; |
| 455 } | 465 } |
| OLD | NEW |