示例#1
0
class TabStop_Shell_ShebangPython(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ("test", """Hallo ${1:now `#!/usr/bin/env python
print "Hallo Welt"
`} end""")
    keys = "test" + EX + JF + "and more"
    wanted = "Hallo now Hallo Welt endand more"
示例#2
0
class TabStop_Shell_ShebangPython(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ('test', """Hallo ${1:now `#!/usr/bin/env %s
print "Hallo Welt"
`} end""" % (os.environ.get('PYTHON', 'python2'), ))
    keys = 'test' + EX + JF + 'and more'
    wanted = 'Hallo now Hallo Welt endand more'
class TestLangmapWithUtf8_ExpectCorrectResult(_VimTest):
    skip_if = lambda self: running_on_windows()  # SendKeys can't send UTF characters
    snippets = ("testme",
"""my snipped ${1:some_default}
and a mirror: $1
$2...$3
$0""")
    keys = "testme" + EX + "hi1" + JF + "hi2" + JF + "hi3" + JF + "hi4"
    wanted ="""my snipped hi1
and a mirror: hi1
hi2...hi3
hi4"""

    def _before_test(self):
        self.vim.send(":set langmap=йq,цw,уe,кr,еt,нy,гu,шi,щo,зp,х[,ъ],фa,ыs,вd,аf,пg,рh,оj,лk,дl,ж\\;,э',яz,чx,сc,мv,иb,тn,ьm,ю.,ё',ЙQ,ЦW,УE,КR,ЕT,НY,ГU,ШI,ЩO,ЗP,Х\{,Ъ\},ФA,ЫS,ВD,АF,ПG,РH,ОJ,ЛK,ДL,Ж\:,Э\",ЯZ,ЧX,СC,МV,ИB,ТN,ЬM,Б\<,Ю\>\n")
示例#4
0
class RecTabStopsWithExpandtab_SpecialIndentProblem_ECR(_ExpandTabs):
    # Windows indents the Something line after pressing return, though it
    # shouldn't because it contains a manual indent. All other vim versions do
    # not do this. Windows vim does not interpret the changes made by :py as
    # changes made 'manually', while the other vim version seem to do so. Since
    # the fault is not with UltiSnips, we simply skip this test on windows
    # completely.
    skip_if = lambda self: running_on_windows()
    snippets = (("m1", "Something"), ("m", "\t$0"))
    keys = "m" + EX + "m1" + EX + "\nHallo"
    wanted = "   Something\n        Hallo"

    def _extra_vim_config(self, vim_config):
        _ExpandTabs._extra_vim_config(self, vim_config)
        vim_config.append("set indentkeys=o,O,*<Return>,<>>,{,}")
        vim_config.append("set indentexpr=8")
示例#5
0
class RecTabStopsWithExpandtab_SpecialIndentProblem_ECR(_ExpandTabs):
    # Windows indents the Something line after pressing return, though it
    # shouldn't because it contains a manual indent. All other vim versions do
    # not do this. Windows vim does not interpret the changes made by :py as
    # changes made 'manually', while the other vim version seem to do so. Since
    # the fault is not with UltiSnips, we simply skip this test on windows
    # completely.
    skip_if = lambda self: running_on_windows()
    snippets = (
        ('m1', 'Something'),
        ('m', '\t$0'),
    )
    keys = 'm' + EX + 'm1' + EX + '\nHallo'
    wanted = '   Something\n        Hallo'

    def _extra_options_pre_init(self, vim_config):
        _ExpandTabs._extra_options_pre_init(self, vim_config)
        vim_config.append('set indentkeys=o,O,*<Return>,<>>,{,}')
        vim_config.append('set indentexpr=8')
class TabStop_Shell_TextInNextLine(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ("test", "hi `echo hallo`\nWeiter")
    keys = "test" + EX + "and more"
    wanted = "hi hallo\nWeiterand more"
class TabStop_Shell_WithUmlauts(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ("test", "hi `echo höüäh` you!")
    keys = "test" + EX + "and more"
    wanted = "hi höüäh you!and more"
class TabStop_Shell_SimpleExample(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ("test", "hi `echo hallo` you!")
    keys = "test" + EX + "and more"
    wanted = "hi hallo you!and more"
class SnippetOptions_ExpandInwordSnippetsWithOtherChars_Expand3(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = (('test', 'Expand me!', '', 'i'), )
    keys = 'ßßtest' + EX
    wanted = 'ßßExpand me!'
示例#10
0
class SnippetOptions_ExpandInwordSnippetsWithOtherChars_Expand3(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = (("test", "Expand me!", "", "i"), )
    keys = "ßßtest" + EX
    wanted = "ßßExpand me!"
示例#11
0
class TabStop_Shell_InDefValue_Overwrite(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ('test', 'Hallo ${1:now `echo fromecho`} end')
    keys = 'test' + EX + 'overwrite' + JF + 'and more'
    wanted = 'Hallo overwrite endand more'
示例#12
0
class TabStop_Shell_TextInNextLine(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ('test', 'hi `echo hallo`\nWeiter')
    keys = 'test' + EX + 'and more'
    wanted = 'hi hallo\nWeiterand more'
示例#13
0
class TabStop_Shell_WithUmlauts(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ('test', 'hi `echo höüäh` you!')
    keys = 'test' + EX + 'and more'
    wanted = 'hi höüäh you!and more'
示例#14
0
class TabStop_Shell_SimpleExample(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ('test', 'hi `echo hallo` you!')
    keys = 'test' + EX + 'and more'
    wanted = 'hi hallo you!and more'
示例#15
0
class _UmlautsBase(_VimTest):
    # SendKeys can't send UTF characters
    skip_if = lambda self: running_on_windows()
示例#16
0
class TabStop_Shell_InDefValue_Overwrite(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ("test", "Hallo ${1:now `echo fromecho`} end")
    keys = "test" + EX + "overwrite" + JF + "and more"
    wanted = "Hallo overwrite endand more"
示例#17
0
class TabStop_Shell_TestEscapedCharsAndShellVars_Overwrite(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ("test", r"""`hi="blah"; echo \`echo "$hi"\``""")
    keys = "test" + EX
    wanted = "blah"
示例#18
0
class TabStop_Shell_TestEscapedChars_Overwrite(_VimTest):
    skip_if = lambda self: running_on_windows()
    snippets = ('test', r"""`echo \`echo "\\$hi"\``""")
    keys = 'test' + EX
    wanted = '$hi'