dart-sdk/pkg/analysis_server/test/search/search_result_test.dart
Brian Wilkerson abd80dc17d Migrate some tests in server
Change-Id: Ic7b3c155529dc241f3cd3ec4cc79ee60fb4295b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194208
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-07 17:08:57 +00:00

53 lines
2 KiB
Dart

// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
void main() {
defineReflectiveSuite(() {
defineReflectiveTests(SearchResultKindTest);
});
}
@reflectiveTest
class SearchResultKindTest {
void test_fromEngine() {
expect(newSearchResultKind_fromEngine(MatchKind.DECLARATION),
SearchResultKind.DECLARATION);
expect(
newSearchResultKind_fromEngine(MatchKind.READ), SearchResultKind.READ);
expect(newSearchResultKind_fromEngine(MatchKind.READ_WRITE),
SearchResultKind.READ_WRITE);
expect(newSearchResultKind_fromEngine(MatchKind.WRITE),
SearchResultKind.WRITE);
expect(newSearchResultKind_fromEngine(MatchKind.REFERENCE),
SearchResultKind.REFERENCE);
expect(newSearchResultKind_fromEngine(MatchKind.INVOCATION),
SearchResultKind.INVOCATION);
}
void test_fromName() {
expect(SearchResultKind(SearchResultKind.DECLARATION.name),
SearchResultKind.DECLARATION);
expect(SearchResultKind(SearchResultKind.READ.name), SearchResultKind.READ);
expect(SearchResultKind(SearchResultKind.READ_WRITE.name),
SearchResultKind.READ_WRITE);
expect(
SearchResultKind(SearchResultKind.WRITE.name), SearchResultKind.WRITE);
expect(SearchResultKind(SearchResultKind.REFERENCE.name),
SearchResultKind.REFERENCE);
expect(SearchResultKind(SearchResultKind.INVOCATION.name),
SearchResultKind.INVOCATION);
expect(SearchResultKind(SearchResultKind.UNKNOWN.name),
SearchResultKind.UNKNOWN);
}
void test_toString() {
expect(SearchResultKind.DECLARATION.toString(),
'SearchResultKind.DECLARATION');
}
}