Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart

Issue 1843513003: tests to assert completion suggestion replacementLength includes entire URI (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/test/domain_completion_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/plugin/protocol/protocol.dart'; 7 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart'; 8 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart';
9 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dar t'; 9 import 'package:analysis_server/src/services/completion/dart/uri_contributor.dar t';
10 import 'package:analyzer/file_system/memory_file_system.dart'; 10 import 'package:analyzer/file_system/memory_file_system.dart';
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 test_import_package2() async { 251 test_import_package2() async {
252 addPackageSource('foo', 'foo.dart', 'library foo;'); 252 addPackageSource('foo', 'foo.dart', 'library foo;');
253 addPackageSource('foo', 'baz/too.dart', 'library too;'); 253 addPackageSource('foo', 'baz/too.dart', 'library too;');
254 addPackageSource('bar', 'bar.dart', 'library bar;'); 254 addPackageSource('bar', 'bar.dart', 'library bar;');
255 addTestSource('import "package:foo/baz/^" import'); 255 addTestSource('import "package:foo/baz/^" import');
256 await computeSuggestions(); 256 await computeSuggestions();
257 assertSuggest('package:foo/baz/too.dart', 257 assertSuggest('package:foo/baz/too.dart',
258 csKind: CompletionSuggestionKind.IMPORT); 258 csKind: CompletionSuggestionKind.IMPORT);
259 } 259 }
260 260
261 test_import_package2_with_trailing() async {
262 addPackageSource('foo', 'foo.dart', 'library foo;');
263 addPackageSource('foo', 'baz/too.dart', 'library too;');
264 addPackageSource('bar', 'bar.dart', 'library bar;');
265 addTestSource('import "package:foo/baz/^.dart" import');
266 await computeSuggestions();
267 assertSuggest('package:foo/baz/too.dart',
268 csKind: CompletionSuggestionKind.IMPORT);
269 expect(replacementOffset, completionOffset - 16);
270 expect(replacementLength, 5 + 16);
271 }
272
261 test_import_package2_raw() async { 273 test_import_package2_raw() async {
262 addPackageSource('foo', 'foo.dart', 'library foo;'); 274 addPackageSource('foo', 'foo.dart', 'library foo;');
263 addPackageSource('foo', 'baz/too.dart', 'library too;'); 275 addPackageSource('foo', 'baz/too.dart', 'library too;');
264 addPackageSource('bar', 'bar.dart', 'library bar;'); 276 addPackageSource('bar', 'bar.dart', 'library bar;');
265 addTestSource('import r"package:foo/baz/^" import'); 277 addTestSource('import r"package:foo/baz/^" import');
266 await computeSuggestions(); 278 await computeSuggestions();
267 assertSuggest('package:foo/baz/too.dart', 279 assertSuggest('package:foo/baz/too.dart',
268 csKind: CompletionSuggestionKind.IMPORT); 280 csKind: CompletionSuggestionKind.IMPORT);
269 } 281 }
270 282
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 assertNotSuggested('foo/'); 564 assertNotSuggested('foo/');
553 assertNotSuggested('foo/bar.dart'); 565 assertNotSuggested('foo/bar.dart');
554 assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT); 566 assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
555 } 567 }
556 } 568 }
557 569
558 class _TestWinResourceProvider extends MemoryResourceProvider { 570 class _TestWinResourceProvider extends MemoryResourceProvider {
559 @override 571 @override
560 Context get pathContext => windows; 572 Context get pathContext => windows;
561 } 573 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/domain_completion_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698