Chromium Code Reviews| Index: pkg/analysis_server/test/src/computer/import_elements_computer_test.dart |
| diff --git a/pkg/analysis_server/test/src/computer/import_elements_computer_test.dart b/pkg/analysis_server/test/src/computer/import_elements_computer_test.dart |
| index 3dc4631115da56de53235751de09e309f12e2c9f..63d54320ca920119ae47575ed16ad8be6041fc42 100644 |
| --- a/pkg/analysis_server/test/src/computer/import_elements_computer_test.dart |
| +++ b/pkg/analysis_server/test/src/computer/import_elements_computer_test.dart |
| @@ -58,6 +58,24 @@ class ImportElementsComputerTest extends AbstractContextTest { |
| path = provider.convertPath('/test.dart'); |
| } |
| + test_createEdits_addImport_noDirectives() async { |
|
scheglov
2017/08/14 18:37:51
Maybe also worth to add a test with parts.
Brian Wilkerson
2017/08/14 19:59:20
Absolutely. In fact, I think you found a bug. But
|
| + await createBuilder(''' |
| +main() { |
| + // paste here |
| +} |
| +'''); |
| + await computeChanges(<ImportedElements>[ |
| + new ImportedElements('/lib/math/math.dart', '', <String>['Random']) |
| + ]); |
| + assertChanges(''' |
| +import 'dart:math'; |
| + |
| +main() { |
| + // paste here |
| +} |
| +'''); |
| + } |
| + |
| test_createEdits_addImport_noPrefix() async { |
| Source fooSource = addPackageSource('pkg', 'foo.dart', ''); |
| await createBuilder(''' |