def MatchesSemanticTrigger_RegexTrigger_test(): ok_( cu._MatchesSemanticTrigger('foo.bar', 4, [cu._PrepareTrigger(r're!\w+\.')])) ok_(not cu._MatchesSemanticTrigger('foo . bar', 5, [cu._PrepareTrigger(r're!\w+\.')]))
def MatchesSemanticTrigger_RegexTrigger_test(): ok_( cu._MatchesSemanticTrigger( 'foo.bar', 4, [ cu._PrepareTrigger( r're!\w+\.' ) ] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo . bar', 5, [ cu._PrepareTrigger( r're!\w+\.' ) ] ) )
def MatchesSemanticTrigger_OneTriggerMatches_test(): ok_( cu._MatchesSemanticTrigger('foo::bar', 5, [ cu._PrepareTrigger('.'), cu._PrepareTrigger(';'), cu._PrepareTrigger('::') ]))
def MatchesSemanticTrigger_OneTriggerMatches_test(): triggers = [ cu._PrepareTrigger('.'), cu._PrepareTrigger(';'), cu._PrepareTrigger('::') ] assert_that(cu._MatchesSemanticTrigger('foo::bar', 5, 8, triggers))
def MatchesSemanticTrigger_Basic_test(): ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 7, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 6, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 5, ['.'] ) ) ok_( cu._MatchesSemanticTrigger( 'foo.bar', 4, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 3, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 2, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 1, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 0, ['.'] ) )
def MatchesSemanticTrigger_BadInput_test(): triggers = [cu._PrepareTrigger('.')] ok_(not cu._MatchesSemanticTrigger('foo.bar', 10, 7, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', -1, 7, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', 4, -1, triggers)) ok_(not cu._MatchesSemanticTrigger('', -1, 0, triggers)) ok_(not cu._MatchesSemanticTrigger('', 0, 0, triggers)) ok_(not cu._MatchesSemanticTrigger('', 1, 0, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', 4, 7, []))
def MatchesSemanticTrigger_BadInput_test(): triggers = [ cu._PrepareTrigger( '.' ) ] ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 10, 7, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', -1, 7, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 4, -1, triggers ) ) ok_( not cu._MatchesSemanticTrigger( '', -1, 0, triggers ) ) ok_( not cu._MatchesSemanticTrigger( '', 0, 0, triggers ) ) ok_( not cu._MatchesSemanticTrigger( '', 1, 0, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 4, 7, [] ) )
def MatchesSemanticTrigger_BadInput_test(): ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 10, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', -1, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( '', -1, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( '', 0, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( '', 1, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 4, [] ) )
def MatchesSemanticTrigger_LongerTrigger_test(): triggers = [cu._PrepareTrigger('::')] ok_(not cu._MatchesSemanticTrigger('foo::bar', 6, 8, triggers)) ok_(cu._MatchesSemanticTrigger('foo::bar', 5, 8, triggers)) ok_(cu._MatchesSemanticTrigger('foo::bar', 4, 8, triggers)) ok_(cu._MatchesSemanticTrigger('foo::bar', 3, 8, triggers)) ok_(not cu._MatchesSemanticTrigger('foo::bar', 4, 4, triggers)) ok_(not cu._MatchesSemanticTrigger('foo::bar', 3, 4, triggers))
def MatchesSemanticTrigger_LongerTrigger_test(): triggers = [ cu._PrepareTrigger( '::' ) ] ok_( not cu._MatchesSemanticTrigger( 'foo::bar', 6, 8, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo::bar', 5, 8, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo::bar', 4, 8, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo::bar', 3, 8, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo::bar', 4, 4, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo::bar', 3, 4, triggers ) )
def MatchesSemanticTrigger_LongerTrigger_test(): ok_( cu._MatchesSemanticTrigger( 'foo::bar', 5, ['::'] ) ) ok_( not cu._MatchesSemanticTrigger( 'foo::bar', 4, ['::'] ) )
def MatchesSemanticTrigger_TriggerIsWrong_test(): ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 4, [':'] ) )
def MatchesSemanticTrigger_TriggerIsWrong_test(): ok_(not cu._MatchesSemanticTrigger('foo.bar', 4, [cu._PrepareTrigger(':')]) )
def MatchesSemanticTrigger_TriggerBetweenWords_test(): ok_( cu._MatchesSemanticTrigger( 'foo . bar', 5, ['.'] ) )
def MatchesSemanticTrigger_TriggerBetweenWords_test(): triggers = [ cu._PrepareTrigger( '.' ) ] ok_( not cu._MatchesSemanticTrigger( 'foo . bar', 6, 9, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo . bar', 5, 9, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo . bar', 4, 9, triggers ) )
def MatchesSemanticTrigger_TriggerIsWrong_test(): triggers = [cu._PrepareTrigger(':')] ok_(not cu._MatchesSemanticTrigger('foo.bar', 4, 7, triggers))
def MatchesSemanticTrigger_TriggerBetweenWords_test(): triggers = [cu._PrepareTrigger('.')] ok_(not cu._MatchesSemanticTrigger('foo . bar', 6, 9, triggers)) ok_(cu._MatchesSemanticTrigger('foo . bar', 5, 9, triggers)) ok_(cu._MatchesSemanticTrigger('foo . bar', 4, 9, triggers))
def MatchesSemanticTrigger_TriggerIsWrong_test(): ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 4, [cu._PrepareTrigger( ':' )] ) )
def MatchesSemanticTrigger_JustTrigger_test(): ok_(cu._MatchesSemanticTrigger('.', 1, [cu._PrepareTrigger('.')])) ok_(not cu._MatchesSemanticTrigger('.', 0, [cu._PrepareTrigger('.')]))
def MatchesSemanticTrigger_RegexTrigger_test(): triggers = [cu._PrepareTrigger(r're!\w+\.')] ok_(cu._MatchesSemanticTrigger('foo.bar', 4, 8, triggers)) ok_(not cu._MatchesSemanticTrigger('foo . bar', 5, 8, triggers))
def MatchesSemanticTrigger_OneTriggerMatches_test(): triggers = [ cu._PrepareTrigger( '.' ), cu._PrepareTrigger( ';' ), cu._PrepareTrigger( '::' ) ] ok_( cu._MatchesSemanticTrigger( 'foo::bar', 5, 8, triggers ) )
def MatchesSemanticTrigger_TriggerIsWrong_test(): triggers = [ cu._PrepareTrigger( ':' ) ] ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 4, 7, triggers ) )
def MatchesSemanticTrigger_JustTrigger_test(): triggers = [ cu._PrepareTrigger( '.' ) ] assert_that( not cu._MatchesSemanticTrigger( '.', 2, 2, triggers ) ) assert_that( cu._MatchesSemanticTrigger( '.', 1, 1, triggers ) ) assert_that( not cu._MatchesSemanticTrigger( '.', 0, 0, triggers ) )
def MatchesSemanticTrigger_OneTriggerMatches_test(): ok_( cu._MatchesSemanticTrigger( 'foo::bar', 5, ['.', ';', '::'] ) )
def MatchesSemanticTrigger_TriggerBetweenWords_test(): ok_( cu._MatchesSemanticTrigger( 'foo . bar', 5, [cu._PrepareTrigger( '.' )] ) )
def MatchesSemanticTrigger_JustTrigger_test(): triggers = [cu._PrepareTrigger('.')] ok_(not cu._MatchesSemanticTrigger('.', 2, 2, triggers)) ok_(cu._MatchesSemanticTrigger('.', 1, 1, triggers)) ok_(not cu._MatchesSemanticTrigger('.', 0, 0, triggers))
def MatchesSemanticTrigger_JustTrigger_test(): ok_( cu._MatchesSemanticTrigger( '.', 1, [cu._PrepareTrigger( '.' )] ) ) ok_( not cu._MatchesSemanticTrigger( '.', 0, [cu._PrepareTrigger( '.' )] ) )
def MatchesSemanticTrigger_TriggerBetweenWords_test(): ok_(cu._MatchesSemanticTrigger('foo . bar', 5, [cu._PrepareTrigger('.')]))
def MatchesSemanticTrigger_JustTrigger_test(): ok_( cu._MatchesSemanticTrigger( '.', 1, ['.'] ) ) ok_( not cu._MatchesSemanticTrigger( '.', 0, ['.'] ) )
def MatchesSemanticTrigger_RegexTrigger_test(): triggers = [ cu._PrepareTrigger( r're!\w+\.' ) ] ok_( cu._MatchesSemanticTrigger( 'foo.bar', 4, 8, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo . bar', 5, 8, triggers ) )
def MatchesSemanticTrigger_JustTrigger_test(): triggers = [ cu._PrepareTrigger( '.' ) ] ok_( not cu._MatchesSemanticTrigger( '.', 2, 2, triggers ) ) ok_( cu._MatchesSemanticTrigger( '.', 1, 1, triggers ) ) ok_( not cu._MatchesSemanticTrigger( '.', 0, 0, triggers ) )
def MatchesSemanticTrigger_Basic_test(): triggers = [cu._PrepareTrigger('.')] ok_(not cu._MatchesSemanticTrigger('foo.bar', 7, 7, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', 6, 7, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', 5, 7, triggers)) ok_(cu._MatchesSemanticTrigger('foo.bar', 4, 7, triggers)) ok_(cu._MatchesSemanticTrigger('foo.bar', 3, 7, triggers)) ok_(cu._MatchesSemanticTrigger('foo.bar', 2, 7, triggers)) ok_(cu._MatchesSemanticTrigger('foo.bar', 1, 7, triggers)) ok_(cu._MatchesSemanticTrigger('foo.bar', 0, 7, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', 3, 3, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', 2, 3, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', 1, 3, triggers)) ok_(not cu._MatchesSemanticTrigger('foo.bar', 0, 3, triggers))
def MatchesSemanticTrigger_Basic_test(): triggers = [ cu._PrepareTrigger( '.' ) ] ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 7, 7, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 6, 7, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 5, 7, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo.bar', 4, 7, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo.bar', 3, 7, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo.bar', 2, 7, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo.bar', 1, 7, triggers ) ) ok_( cu._MatchesSemanticTrigger( 'foo.bar', 0, 7, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 3, 3, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 2, 3, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 1, 3, triggers ) ) ok_( not cu._MatchesSemanticTrigger( 'foo.bar', 0, 3, triggers ) )