Add unit tests to test fix of #182 (allow colon remap)

This commit is contained in:
mrossinek 2019-02-23 11:20:17 +01:00 committed by Tomas Babej
parent 504aefadef
commit 97bfa1315c
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5

View file

@ -120,3 +120,91 @@ class TestCustomMapping(IntegrationTest):
for task in self.tasks:
task.refresh()
class TestColonRemap(IntegrationTest):
viminput = """
* [ ] test task 1 #{uuid}
* [ ] test task 2 #{uuid}
"""
vimoutput = """
* [X] test task 1 #{uuid}
* [X] test task 2 #{uuid}
"""
tasks = [
dict(description="test task 1"),
dict(description="test task 2"),
]
def execute(self):
self.command('nnoremap ; :')
self.command('nnoremap : ;')
self.command('vnoremap ; :')
self.command('vnoremap : ;')
self.client.normal('1gg')
sleep(0.5)
self.client.feedkeys(r'\\td')
sleep(0.5)
self.client.normal('2gg')
sleep(0.5)
self.client.normal('V')
sleep(0.5)
self.client.feedkeys(r'\\td')
sleep(0.5)
for task in self.tasks:
task.refresh()
class TestColonRemapWithCustomMap(IntegrationTest):
viminput = """
* [ ] test task 1 #{uuid}
* [ ] test task 2 #{uuid}
"""
vimoutput = """
* [X] test task 1 #{uuid}
* [X] test task 2 #{uuid}
"""
tasks = [
dict(description="test task 1"),
dict(description="test task 2"),
]
def configure_global_varialbes(self):
super(TestColonRemapWithCustomMap, self).configure_global_varialbes()
self.command('let g:taskwiki_maplocalleader=",t"')
def execute(self):
self.command('nnoremap ; :')
self.command('nnoremap : ;')
self.command('vnoremap ; :')
self.command('vnoremap : ;')
self.client.normal('1gg')
sleep(0.5)
self.client.feedkeys(',td')
sleep(0.5)
self.client.normal('2gg')
sleep(0.5)
self.client.normal('V')
sleep(0.5)
self.client.feedkeys(',td')
sleep(0.5)
for task in self.tasks:
task.refresh()