| 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.dart.combinator; | 5 library test.services.completion.dart.combinator; |
| 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/combinator_computer.dart
'; | 8 import 'package:analysis_server/src/services/completion/combinator_computer.dart
'; |
| 9 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 9 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 10 | 11 |
| 11 import '../../reflective_tests.dart'; | 12 import '../../reflective_tests.dart'; |
| 12 import 'completion_test_util.dart'; | 13 import 'completion_test_util.dart'; |
| 13 | 14 |
| 14 main() { | 15 main() { |
| 15 groupSep = ' | '; | 16 groupSep = ' | '; |
| 16 runReflectiveTests(CombinatorComputerTest); | 17 runReflectiveTests(CombinatorComputerTest); |
| 17 } | 18 } |
| 18 | 19 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 class C { } | 55 class C { } |
| 55 class D { }'''); | 56 class D { }'''); |
| 56 addTestSource(''' | 57 addTestSource(''' |
| 57 import "/testAB.dart" hide ^; | 58 import "/testAB.dart" hide ^; |
| 58 import "/testCD.dart"; | 59 import "/testCD.dart"; |
| 59 class X {}'''); | 60 class X {}'''); |
| 60 computeFast(); | 61 computeFast(); |
| 61 return computeFull((bool result) { | 62 return computeFull((bool result) { |
| 62 assertSuggestClass( | 63 assertSuggestClass( |
| 63 'A', | 64 'A', |
| 64 CompletionRelevance.DEFAULT, | 65 COMPLETION_RELEVANCE_DEFAULT, |
| 65 CompletionSuggestionKind.IDENTIFIER); | 66 CompletionSuggestionKind.IDENTIFIER); |
| 66 assertSuggestClass( | 67 assertSuggestClass( |
| 67 'B', | 68 'B', |
| 68 CompletionRelevance.DEFAULT, | 69 COMPLETION_RELEVANCE_DEFAULT, |
| 69 CompletionSuggestionKind.IDENTIFIER); | 70 CompletionSuggestionKind.IDENTIFIER); |
| 70 assertSuggestClass( | 71 assertSuggestClass( |
| 71 'PB', | 72 'PB', |
| 72 CompletionRelevance.DEFAULT, | 73 COMPLETION_RELEVANCE_DEFAULT, |
| 73 CompletionSuggestionKind.IDENTIFIER); | 74 CompletionSuggestionKind.IDENTIFIER); |
| 74 assertSuggestTopLevelVar( | 75 assertSuggestTopLevelVar( |
| 75 'T1', | 76 'T1', |
| 76 null, | 77 null, |
| 77 CompletionRelevance.DEFAULT, | 78 COMPLETION_RELEVANCE_DEFAULT, |
| 78 CompletionSuggestionKind.IDENTIFIER); | 79 CompletionSuggestionKind.IDENTIFIER); |
| 79 assertSuggestFunction( | 80 assertSuggestFunction( |
| 80 'F1', | 81 'F1', |
| 81 'PB', | 82 'PB', |
| 82 false, | 83 false, |
| 83 CompletionRelevance.DEFAULT, | 84 COMPLETION_RELEVANCE_DEFAULT, |
| 84 CompletionSuggestionKind.IDENTIFIER); | 85 CompletionSuggestionKind.IDENTIFIER); |
| 85 assertNotSuggested('C'); | 86 assertNotSuggested('C'); |
| 86 assertNotSuggested('D'); | 87 assertNotSuggested('D'); |
| 87 assertNotSuggested('X'); | 88 assertNotSuggested('X'); |
| 88 assertNotSuggested('Object'); | 89 assertNotSuggested('Object'); |
| 89 }); | 90 }); |
| 90 } | 91 } |
| 91 | 92 |
| 92 test_Combinator_show() { | 93 test_Combinator_show() { |
| 93 // SimpleIdentifier HideCombinator ImportDirective | 94 // SimpleIdentifier HideCombinator ImportDirective |
| (...skipping 13 matching lines...) Expand all Loading... |
| 107 class C { } | 108 class C { } |
| 108 class D { }'''); | 109 class D { }'''); |
| 109 addTestSource(''' | 110 addTestSource(''' |
| 110 import "/testAB.dart" show ^; | 111 import "/testAB.dart" show ^; |
| 111 import "/testCD.dart"; | 112 import "/testCD.dart"; |
| 112 class X {}'''); | 113 class X {}'''); |
| 113 computeFast(); | 114 computeFast(); |
| 114 return computeFull((bool result) { | 115 return computeFull((bool result) { |
| 115 assertSuggestClass( | 116 assertSuggestClass( |
| 116 'A', | 117 'A', |
| 117 CompletionRelevance.DEFAULT, | 118 COMPLETION_RELEVANCE_DEFAULT, |
| 118 CompletionSuggestionKind.IDENTIFIER); | 119 CompletionSuggestionKind.IDENTIFIER); |
| 119 assertSuggestClass( | 120 assertSuggestClass( |
| 120 'B', | 121 'B', |
| 121 CompletionRelevance.DEFAULT, | 122 COMPLETION_RELEVANCE_DEFAULT, |
| 122 CompletionSuggestionKind.IDENTIFIER); | 123 CompletionSuggestionKind.IDENTIFIER); |
| 123 assertSuggestClass( | 124 assertSuggestClass( |
| 124 'PB', | 125 'PB', |
| 125 CompletionRelevance.DEFAULT, | 126 COMPLETION_RELEVANCE_DEFAULT, |
| 126 CompletionSuggestionKind.IDENTIFIER); | 127 CompletionSuggestionKind.IDENTIFIER); |
| 127 assertSuggestTopLevelVar( | 128 assertSuggestTopLevelVar( |
| 128 'T1', | 129 'T1', |
| 129 null, | 130 null, |
| 130 CompletionRelevance.DEFAULT, | 131 COMPLETION_RELEVANCE_DEFAULT, |
| 131 CompletionSuggestionKind.IDENTIFIER); | 132 CompletionSuggestionKind.IDENTIFIER); |
| 132 assertSuggestFunction( | 133 assertSuggestFunction( |
| 133 'F1', | 134 'F1', |
| 134 'PB', | 135 'PB', |
| 135 false, | 136 false, |
| 136 CompletionRelevance.DEFAULT, | 137 COMPLETION_RELEVANCE_DEFAULT, |
| 137 CompletionSuggestionKind.IDENTIFIER); | 138 CompletionSuggestionKind.IDENTIFIER); |
| 138 assertSuggestClass( | 139 assertSuggestClass( |
| 139 'Clz', | 140 'Clz', |
| 140 CompletionRelevance.DEFAULT, | 141 COMPLETION_RELEVANCE_DEFAULT, |
| 141 CompletionSuggestionKind.IDENTIFIER); | 142 CompletionSuggestionKind.IDENTIFIER); |
| 142 assertSuggestFunctionTypeAlias( | 143 assertSuggestFunctionTypeAlias( |
| 143 'F2', | 144 'F2', |
| 144 null, | 145 null, |
| 145 false, | 146 false, |
| 146 CompletionRelevance.DEFAULT, | 147 COMPLETION_RELEVANCE_DEFAULT, |
| 147 CompletionSuggestionKind.IDENTIFIER); | 148 CompletionSuggestionKind.IDENTIFIER); |
| 148 assertNotSuggested('C'); | 149 assertNotSuggested('C'); |
| 149 assertNotSuggested('D'); | 150 assertNotSuggested('D'); |
| 150 assertNotSuggested('X'); | 151 assertNotSuggested('X'); |
| 151 assertNotSuggested('Object'); | 152 assertNotSuggested('Object'); |
| 152 }); | 153 }); |
| 153 } | 154 } |
| 154 } | 155 } |
| OLD | NEW |