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

Side by Side Diff: pkg/analysis_server/test/src/computer/import_elements_computer_test.dart

Issue 2992133002: Add a test for import-aware paste (Closed)
Patch Set: Created 3 years, 4 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 | « no previous file | 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analysis_server/protocol/protocol_generated.dart'; 7 import 'package:analysis_server/protocol/protocol_generated.dart';
8 import 'package:analysis_server/src/computer/import_elements_computer.dart'; 8 import 'package:analysis_server/src/computer/import_elements_computer.dart';
9 import 'package:analyzer/src/dart/analysis/driver.dart'; 9 import 'package:analyzer/src/dart/analysis/driver.dart';
10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; 10 import 'package:analyzer_plugin/protocol/protocol_common.dart';
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 Source fooSource = addPackageSource('pkg', 'foo.dart', ''); 168 Source fooSource = addPackageSource('pkg', 'foo.dart', '');
169 await createBuilder(''' 169 await createBuilder('''
170 import 'package:pkg/foo.dart' show A; 170 import 'package:pkg/foo.dart' show A;
171 '''); 171 ''');
172 await computeChanges(<ImportedElements>[ 172 await computeChanges(<ImportedElements>[
173 new ImportedElements(fooSource.fullName, '', <String>['A']) 173 new ImportedElements(fooSource.fullName, '', <String>['A'])
174 ]); 174 ]);
175 assertNoChanges(); 175 assertNoChanges();
176 } 176 }
177 177
178 test_createEdits_importSelf() async {
179 await createBuilder('''
180 class A {
181 A parent;
182 }
183 ''');
184 await computeChanges(<ImportedElements>[
185 new ImportedElements(path, '', <String>['A'])
186 ]);
187 assertNoChanges();
188 }
189
178 test_createEdits_noElements() async { 190 test_createEdits_noElements() async {
179 await createBuilder(''); 191 await createBuilder('');
180 await computeChanges(<ImportedElements>[]); 192 await computeChanges(<ImportedElements>[]);
181 assertNoChanges(); 193 assertNoChanges();
182 } 194 }
183 195
184 test_createEdits_removeHide_firstInCombinator() async { 196 test_createEdits_removeHide_firstInCombinator() async {
185 Source fooSource = addPackageSource('pkg', 'foo.dart', ''); 197 Source fooSource = addPackageSource('pkg', 'foo.dart', '');
186 await createBuilder(''' 198 await createBuilder('''
187 import 'package:pkg/foo.dart' hide A, B, C; 199 import 'package:pkg/foo.dart' hide A, B, C;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 import 'package:pkg/foo.dart' hide A, B; 316 import 'package:pkg/foo.dart' hide A, B;
305 '''); 317 ''');
306 await computeChanges(<ImportedElements>[ 318 await computeChanges(<ImportedElements>[
307 new ImportedElements(fooSource.fullName, '', <String>['A', 'B']) 319 new ImportedElements(fooSource.fullName, '', <String>['A', 'B'])
308 ]); 320 ]);
309 assertChanges(''' 321 assertChanges('''
310 import 'package:pkg/foo.dart'; 322 import 'package:pkg/foo.dart';
311 '''); 323 ''');
312 } 324 }
313 } 325 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698