mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-08 18:03:47 -05:00
Testing functions only (not mappings).
This commit is contained in:
@@ -3,7 +3,6 @@ let s:context = todo#txt#__context__()
|
||||
let s:context['data'] = s:here . '/tc_date.todo.txt'
|
||||
let s:tc = unittest#testcase#new('Date', s:context)
|
||||
|
||||
let s:LEADER = mapleader
|
||||
let s:TODAY = strftime("%Y-%m-%d")
|
||||
|
||||
function! s:tc.test_current_date()
|
||||
@@ -20,7 +19,7 @@ let s:DATE_INSERTED_VISUAL = [
|
||||
|
||||
function! s:tc.test_insert_date_normal_mode()
|
||||
call self.data.goto('lorem_ipsum')
|
||||
execute 'normal ' . s:LEADER . 'd'
|
||||
call self.data.execute('call todo#txt#prepend_date()', 'lorem_ipsum')
|
||||
call self.assert_equal(s:DATE_INSERTED, self.data.get('lorem_ipsum'))
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ let s:here = expand('<sfile>:p:h')
|
||||
let s:tc = unittest#testcase#new('Mask As Done',
|
||||
\ { 'data': s:here . '/tc_mark_as_done.todo.txt' })
|
||||
|
||||
let s:LEADER = mapleader
|
||||
let s:TODAY = strftime("%Y-%m-%d")
|
||||
|
||||
let s:FIRST_TASK_DONE = [
|
||||
@@ -19,17 +18,17 @@ let s:ALL_TASKS_DONE = [
|
||||
|
||||
function! s:tc.test_mark_as_done()
|
||||
call self.data.goto('lorem_ipsum')
|
||||
execute 'normal ' . s:LEADER . 'x'
|
||||
call self.data.execute('call todo#txt#mark_as_done()')
|
||||
call self.assert_equal(s:FIRST_TASK_DONE, self.data.get('lorem_ipsum'))
|
||||
endfunction
|
||||
|
||||
function! s:tc.test_mark_range_as_done()
|
||||
call self.data.execute('normal ' . s:LEADER . 'x', 'lorem_ipsum')
|
||||
call self.data.execute('call todo#txt#mark_as_done()', 'lorem_ipsum')
|
||||
call self.assert_equal(s:ALL_TASKS_DONE, self.data.get('lorem_ipsum'))
|
||||
endfunction
|
||||
|
||||
function! s:tc.test_mark_selection_as_done()
|
||||
call self.data.visual_execute('normal ' . s:LEADER . 'x', 'lorem_ipsum')
|
||||
call self.data.visual_execute('call todo#txt#mark_as_done()', 'lorem_ipsum')
|
||||
call self.assert_equal(s:ALL_TASKS_DONE, self.data.get('lorem_ipsum'))
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user