Example #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"
Example #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")
Example #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")
Example #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!'
Example #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!"
Example #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'
Example #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'
Example #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'
Example #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'
Example #15
0
class _UmlautsBase(_VimTest):
    # SendKeys can't send UTF characters
    skip_if = lambda self: running_on_windows()
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"
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"
Example #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'