2014-07-19 11:45:44 -04:00
|
|
|
from test.vim_test_case import VimTestCase as _VimTest
|
|
|
|
from test.constant import *
|
|
|
|
|
|
|
|
# Simple Expands {{{#
|
2015-01-20 15:26:03 -05:00
|
|
|
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
class _SimpleExpands(_VimTest):
|
2015-01-20 15:26:03 -05:00
|
|
|
snippets = ('hallo', 'Hallo Welt!')
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
|
|
|
|
class SimpleExpand_ExpectCorrectResult(_SimpleExpands):
|
2015-01-20 15:26:03 -05:00
|
|
|
keys = 'hallo' + EX
|
|
|
|
wanted = 'Hallo Welt!'
|
|
|
|
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
class SimpleExpandTwice_ExpectCorrectResult(_SimpleExpands):
|
2015-01-20 15:26:03 -05:00
|
|
|
keys = 'hallo' + EX + '\nhallo' + EX
|
|
|
|
wanted = 'Hallo Welt!\nHallo Welt!'
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
|
|
|
|
class SimpleExpandNewLineAndBackspae_ExpectCorrectResult(_SimpleExpands):
|
2015-01-20 15:26:03 -05:00
|
|
|
keys = 'hallo' + EX + '\nHallo Welt!\n\n\b\b\b\b\b'
|
|
|
|
wanted = 'Hallo Welt!\nHallo We'
|
|
|
|
|
2015-07-11 10:17:50 -04:00
|
|
|
def _extra_vim_config(self, vim_config):
|
2015-01-20 15:26:03 -05:00
|
|
|
vim_config.append('set backspace=eol,start')
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
|
|
|
|
class SimpleExpandTypeAfterExpand_ExpectCorrectResult(_SimpleExpands):
|
2015-01-20 15:26:03 -05:00
|
|
|
keys = 'hallo' + EX + 'and again'
|
|
|
|
wanted = 'Hallo Welt!and again'
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
|
|
|
|
class SimpleExpandTypeAndDelete_ExpectCorrectResult(_SimpleExpands):
|
2015-01-20 15:26:03 -05:00
|
|
|
keys = 'na du hallo' + EX + 'and again\b\b\b\b\bblub'
|
|
|
|
wanted = 'na du Hallo Welt!and blub'
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
|
|
|
|
class DoNotExpandAfterSpace_ExpectCorrectResult(_SimpleExpands):
|
2015-01-20 15:26:03 -05:00
|
|
|
keys = 'hallo ' + EX
|
|
|
|
wanted = 'hallo ' + EX
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
|
|
|
|
class ExitSnippetModeAfterTabstopZero(_VimTest):
|
2015-01-20 15:26:03 -05:00
|
|
|
snippets = ('test', 'SimpleText')
|
|
|
|
keys = 'test' + EX + EX
|
|
|
|
wanted = 'SimpleText' + EX
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
|
|
|
|
class ExpandInTheMiddleOfLine_ExpectCorrectResult(_SimpleExpands):
|
2015-01-20 15:26:03 -05:00
|
|
|
keys = 'Wie hallo gehts' + ESC + 'bhi' + EX
|
|
|
|
wanted = 'Wie Hallo Welt! gehts'
|
|
|
|
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
class MultilineExpand_ExpectCorrectResult(_VimTest):
|
2015-01-20 15:26:03 -05:00
|
|
|
snippets = ('hallo', 'Hallo Welt!\nUnd Wie gehts')
|
|
|
|
keys = 'Wie hallo gehts' + ESC + 'bhi' + EX
|
|
|
|
wanted = 'Wie Hallo Welt!\nUnd Wie gehts gehts'
|
|
|
|
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
class MultilineExpandTestTyping_ExpectCorrectResult(_VimTest):
|
2015-01-20 15:26:03 -05:00
|
|
|
snippets = ('hallo', 'Hallo Welt!\nUnd Wie gehts')
|
|
|
|
wanted = 'Wie Hallo Welt!\nUnd Wie gehtsHuiui! gehts'
|
|
|
|
keys = 'Wie hallo gehts' + ESC + 'bhi' + EX + 'Huiui!'
|
|
|
|
|
|
|
|
|
2014-07-19 11:45:44 -04:00
|
|
|
class SimpleExpandEndingWithNewline_ExpectCorrectResult(_VimTest):
|
2015-01-20 15:26:03 -05:00
|
|
|
snippets = ('hallo', 'Hallo Welt\n')
|
|
|
|
keys = 'hallo' + EX + '\nAnd more'
|
|
|
|
wanted = 'Hallo Welt\n\nAnd more'
|
2014-07-19 11:45:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
# End: Simple Expands #}}}
|