Added tests for tabstops in tabstops

This commit is contained in:
Holger Rapp 2009-07-07 10:27:05 +02:00
parent 9adaccabf1
commit 5dba8710f7
2 changed files with 32 additions and 3 deletions

View File

@ -820,8 +820,6 @@ class SnippetManager(object):
self._current_snippets.pop() self._current_snippets.pop()
return True return True
# else:
# vim.command(":au CursorMoved * py PySnipSnippets.normal_mode_moved()")
self._vstate.update() self._vstate.update()
self._accept_input = True self._accept_input = True
@ -870,7 +868,6 @@ class SnippetManager(object):
if s is not None: if s is not None:
self._current_snippets.append(s) self._current_snippets.append(s)
self._accept_input = True self._accept_input = True
# vim.command(":au CursorMoved * py PySnipSnippets.normal_mode_moved()")
return True return True

32
test.py
View File

@ -225,6 +225,38 @@ class TabStopTestMultilineExpand_ExceptCorrectResult(_VimTest):
wanted = "test hallo one more\nnice world work\n" \ wanted = "test hallo one more\nnice world work\n" \
"test try\nSeem to work World" "test try\nSeem to work World"
class TabStop_TSInDefaultTextRLExample_OverwriteNone_ECR(_VimTest):
snippets = ("test", """<div${1: id="${2:some_id}"}>\n $0\n</div>""")
keys = "test\t"
wanted = """<div id="some_id">\n \n</div>"""
class TabStop_TSInDefaultTextRLExample_OverwriteFirst(_VimTest):
snippets = ("test", """<div${1: id="${2:some_id}"}>\n $0\n</div>""")
keys = "test\t blah\tHallo"
wanted = """<div blah>\n Hallo\n</div>"""
class TabStop_TSInDefaultTextRLExample_DeleteFirst(_VimTest):
snippets = ("test", """<div${1: id="${2:some_id}"}>\n $0\n</div>""")
keys = "test\t" + BS + "tHallo"
wanted = """<div>\n Hallo\n</div>"""
class TabStop_TSInDefaultTextRLExample_OverwriteFirstJumpBack(_VimTest):
snippets = ("test", """<div${1: id="${2:some_id}"}>\n $3 $0\n</div>""")
keys = "test\tHi\ttHallo+SomethingElse\tNupl\tNox"
wanted = """<divSomethingElse>\n Nulp Nox\n</div>"""
class TabStop_TSInDefaultTextRLExample_OverwriteSecond(_VimTest):
snippets = ("test", """<div${1: id="${2:some_id}"}>\n $0\n</div>""")
keys = "test\t\tno\tEnd"
wanted = """<div id="no">\n End\n</div>"""
class TabStop_TSInDefaultTextRLExample_OverwriteSecondTabBack(_VimTest):
snippets = ("test", """<div${1: id="${2:some_id}"}>\n $3 $0\n</div>""")
keys = "test\t\tno\tEnd+yes\tBegin\tHi"
wanted = """<div id="yes">\n Begin Hi\n</div>"""
class TabStop_TSInDefaultTextRLExample_OverwriteSecondTabBackTwice(_VimTest):
snippets = ("test", """<div${1: id="${2:some_id}"}>\n $3 $0\n</div>""")
keys = "test\t\tno\tEnd+yes+ allaway\tThird\tLast"
wanted = """<div allaway>\n Third Last\n</div>"""
print "expand, jump forward, jump backwards should all be individual" print "expand, jump forward, jump backwards should all be individual"
print "Shell eval snippets" print "Shell eval snippets"
print "Tabstop in default text of tabstop. Like in Ruby Dir snippet in TextMate" print "Tabstop in default text of tabstop. Like in Ruby Dir snippet in TextMate"