Update Omnifunc completer Unicode tests

This commit is contained in:
micbou 2017-09-24 13:02:08 +02:00
parent 002500347e
commit d4cddbcc7f
No known key found for this signature in database
GPG Key ID: C7E8FD1F3BDA1E05

View File

@ -24,10 +24,10 @@ from __future__ import absolute_import
# Not installing aliases from python-future; it's unreliable and slow. # Not installing aliases from python-future; it's unreliable and slow.
from builtins import * # noqa from builtins import * # noqa
from hamcrest import assert_that, contains, contains_string, empty, has_entries from hamcrest import assert_that, contains, empty, has_entries
from ycm.tests.test_utils import ( ExpectedFailure, MockVimBuffers, from ycm.tests.test_utils import ( MockVimBuffers, MockVimModule, ToBytesOnPY2,
MockVimModule, ToBytesOnPY2, VimBuffer ) VimBuffer )
MockVimModule() MockVimModule()
from ycm import vimsupport from ycm import vimsupport
@ -398,8 +398,6 @@ def OmniCompleter_GetCompletions_NoCache_ObjectListObject_test( ycm ):
) )
@ExpectedFailure( 'Filtering on unicode is not supported by the server',
contains_string( "value for 'completions' was <[]>" ) )
@YouCompleteMeInstance( { 'cache_omnifunc': 1, 'semantic_triggers': TRIGGERS } ) @YouCompleteMeInstance( { 'cache_omnifunc': 1, 'semantic_triggers': TRIGGERS } )
def OmniCompleter_GetCompletions_Cache_List_Unicode_test( ycm ): def OmniCompleter_GetCompletions_Cache_List_Unicode_test( ycm ):
def Omnifunc( findstart, base ): def Omnifunc( findstart, base ):
@ -417,9 +415,9 @@ def OmniCompleter_GetCompletions_Cache_List_Unicode_test( ycm ):
assert_that( assert_that(
ycm.GetCompletionResponse(), ycm.GetCompletionResponse(),
has_entries( { has_entries( {
'completions': ToBytesOnPY2( [ '†est', 'completions': [ 'å_unicode_identifier',
'å_unicode_identifier', 'πππππππ yummy πie',
'πππππππ yummy πie' ] ), '†est' ],
'completion_start_column': 13 'completion_start_column': 13
} ) } )
) )
@ -450,8 +448,6 @@ def OmniCompleter_GetCompletions_NoCache_List_Unicode_test( ycm ):
) )
@ExpectedFailure( 'Filtering on unicode is not supported by the server',
contains_string( "value for 'completions' was <[]>" ) )
@YouCompleteMeInstance( { 'cache_omnifunc': 1, 'semantic_triggers': TRIGGERS } ) @YouCompleteMeInstance( { 'cache_omnifunc': 1, 'semantic_triggers': TRIGGERS } )
def OmniCompleter_GetCompletions_Cache_List_Filter_Unicode_test( ycm ): def OmniCompleter_GetCompletions_Cache_List_Filter_Unicode_test( ycm ):
def Omnifunc( findstart, base ): def Omnifunc( findstart, base ):
@ -469,7 +465,7 @@ def OmniCompleter_GetCompletions_Cache_List_Filter_Unicode_test( ycm ):
assert_that( assert_that(
ycm.GetCompletionResponse(), ycm.GetCompletionResponse(),
has_entries( { has_entries( {
'completions': ToBytesOnPY2( [ 'πππππππ yummy πie' ] ), 'completions': [ 'πππππππ yummy πie' ],
'completion_start_column': 13 'completion_start_column': 13
} ) } )
) )
@ -498,8 +494,6 @@ def OmniCompleter_GetCompletions_NoCache_List_Filter_Unicode_test( ycm ):
) )
@ExpectedFailure( 'Filtering on unicode is not supported by the server',
contains_string( "value for 'completions' was <[]>" ) )
@YouCompleteMeInstance( { 'cache_omnifunc': 1, 'semantic_triggers': TRIGGERS } ) @YouCompleteMeInstance( { 'cache_omnifunc': 1, 'semantic_triggers': TRIGGERS } )
def OmniCompleter_GetCompletions_Cache_ObjectList_Unicode_test( ycm ): def OmniCompleter_GetCompletions_Cache_ObjectList_Unicode_test( ycm ):
def Omnifunc( findstart, base ): def Omnifunc( findstart, base ):
@ -532,13 +526,13 @@ def OmniCompleter_GetCompletions_Cache_ObjectList_Unicode_test( ycm ):
assert_that( assert_that(
ycm.GetCompletionResponse(), ycm.GetCompletionResponse(),
has_entries( { has_entries( {
'completions': ToBytesOnPY2( [ { 'completions': [ {
'word': 'π†´ß†π', 'word': 'π†´ß†π',
'abbr': 'ÅııÂʉÍÊ', 'abbr': 'ÅııÂʉÍÊ',
'menu': '˜‰ˆËʉÍÊ', 'menu': '˜‰ˆËʉÍÊ',
'info': 'ȈÏØʉÍÊ', 'info': 'ȈÏØʉÍÊ',
'kind': 'Ê' 'kind': 'Ê'
} ] ), } ],
'completion_start_column': 13 'completion_start_column': 13
} ) } )
) )
@ -591,6 +585,12 @@ def OmniCompleter_GetCompletions_Cache_ObjectListObject_Unicode_test( ycm ):
'menu': '˜‰ˆËʉÍÊ', 'menu': '˜‰ˆËʉÍÊ',
'info': 'ȈÏØʉÍÊ', 'info': 'ȈÏØʉÍÊ',
'kind': 'Ê' 'kind': 'Ê'
}, {
'word': 'ålpha∫et',
'abbr': 'å∫∫®',
'menu': 'µ´~¨á',
'info': '^~fo',
'kind': '˚'
} ), } ),
'completion_start_column': 13 'completion_start_column': 13
} ) } )