| Index: pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart
|
| diff --git a/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart b/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart
|
| index 825d8d36356d461bf4ed2c39db5e2536afa862b6..23462db61e2d0d5514d7732b09cfc6440543f392 100644
|
| --- a/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart
|
| +++ b/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart
|
| @@ -132,6 +132,25 @@ blankLine() {
|
| expect(elements.elements, unorderedEquals(['String']));
|
| }
|
|
|
| + test_dartMath_noPrefix() async {
|
| + String selection = "new Random();";
|
| + String content = """
|
| +import 'dart:math';
|
| +bool randomBool() {
|
| + Random r = $selection
|
| + return r.nextBool();
|
| +}
|
| +""";
|
| + List<ImportedElements> elementsList = await _computeElements(
|
| + content, content.indexOf(selection), selection.length);
|
| + expect(elementsList, hasLength(1));
|
| + ImportedElements elements = elementsList[0];
|
| + expect(elements, isNotNull);
|
| + expect(elements.path, '/lib/math/math.dart');
|
| + expect(elements.prefix, '');
|
| + expect(elements.elements, unorderedEquals(['Random']));
|
| + }
|
| +
|
| test_none_comment() async {
|
| String selection = 'comment';
|
| String content = """
|
|
|