No results for empty query (IdentifierCompleter)
This commit is contained in:
parent
52d8a1236b
commit
a04c3322cc
@ -174,7 +174,7 @@ void IdentifierCompleter::ResultsForQueryAndType(
|
||||
std::vector< Result > &results ) const
|
||||
{
|
||||
FiletypeMap::const_iterator it = filetype_map_.find( filetype );
|
||||
if ( it == filetype_map_.end() )
|
||||
if ( it == filetype_map_.end() || query.empty() )
|
||||
return;
|
||||
|
||||
Bitset query_bitset = LetterBitsetFromString( query );
|
||||
|
@ -64,6 +64,16 @@ std::vector< std::string > Candidates( const std::string &a,
|
||||
} // unnamed namespace
|
||||
|
||||
|
||||
// This differs from what we expect from the ClangCompleter. That one should
|
||||
// return results for an empty query.
|
||||
TEST( IdentifierCompleterTest, EmptyQueryNoResults )
|
||||
{
|
||||
EXPECT_THAT( IdentifierCompleter( Candidates(
|
||||
"foobar" ) ).CandidatesForQuery( "" ),
|
||||
ElementsAre() );
|
||||
}
|
||||
|
||||
|
||||
TEST( IdentifierCompleterTest, OneCandidate )
|
||||
{
|
||||
EXPECT_THAT( IdentifierCompleter( Candidates(
|
||||
|
Loading…
Reference in New Issue
Block a user