Test for exception on no flags from extra conf

This commit is contained in:
Strahinja Val Markovic 2013-11-17 13:45:39 -08:00
parent 19a5bf0500
commit 1f23171c08
3 changed files with 42 additions and 0 deletions

View File

@ -166,6 +166,29 @@ def GetCompletions_ClangCompleter_WorksWhenExtraConfExplicitlyAllowed_test():
CompletionEntryMatcher( 'x' ),
CompletionEntryMatcher( 'y' ) ) )
@with_setup( Setup )
def GetCompletions_ClangCompleter_ExceptionWhenNoFlagsFromExtraConf_test():
app = TestApp( handlers.app )
app.post_json( '/load_extra_conf_file',
{ 'filepath': PathToTestFile(
'noflags/.ycm_extra_conf.py' ) } )
filepath = PathToTestFile( 'noflags/basic.cpp' )
completion_data = BuildRequest( filepath = filepath,
filetype = 'cpp',
contents = open( filepath ).read(),
line_num = 10,
column_num = 6,
start_column = 6 )
response = app.post_json( '/completions',
completion_data,
expect_errors = True )
eq_( response.status_code, httplib.INTERNAL_SERVER_ERROR )
assert_that( response.json,
has_entry( 'exception',
has_entry( 'TYPE', RuntimeError.__name__ ) ) )
@with_setup( Setup )
def GetCompletions_ClangCompleter_ForceSemantic_OnlyFileteredCompletions_test():

View File

@ -0,0 +1,6 @@
def FlagsForFile( filename ):
return {
'flags': [],
'do_cache': True
}

View File

@ -0,0 +1,13 @@
struct Foo {
int x;
int y;
char c;
};
int main()
{
Foo foo;
// The location after the dot is line 11, col 7
foo.
}