mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-18 21:33:07 +02:00
Add unit tests to test fix of #182 (allow colon remap)
This commit is contained in:
parent
504aefadef
commit
97bfa1315c
1 changed files with 88 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue