mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-17 06:13:38 -05:00
Fixes #37. Replacing existing date
This commit is contained in:
@@ -22,6 +22,10 @@ let s:DATE_INSERTED_AFTER_PRIORITY_VISUAL = [
|
||||
\ '(B) ' . s:TODAY . ' Call Dad',
|
||||
\ ]
|
||||
|
||||
let s:DATE_INSERTED_DO_NOTHING = [
|
||||
\ '2014-05-06 example task',
|
||||
\ ]
|
||||
|
||||
function! s:tc.test_insert_date_normal_mode()
|
||||
call self.data.goto('lorem_ipsum')
|
||||
call todo#txt#prepend_date()
|
||||
@@ -49,4 +53,21 @@ function! s:tc.test_insert_date_after_priority_visual_mode()
|
||||
call self.assert_equal(s:DATE_INSERTED_AFTER_PRIORITY_VISUAL, self.data.get('date_after_priority_visual'))
|
||||
endfunction
|
||||
|
||||
function! s:tc.test_insert_with_existing_date()
|
||||
call self.data.execute('call todo#txt#prepend_date()', 'existing_date_no_priority')
|
||||
call self.assert_equal(s:DATE_INSERTED, self.data.get('existing_date_no_priority'))
|
||||
endfunction
|
||||
|
||||
function! s:tc.test_insert_with_existing_date_and_priority()
|
||||
call self.data.execute('call todo#txt#prepend_date()', 'existing_date_after_priority')
|
||||
call self.assert_equal(s:DATE_INSERTED_AFTER_PRIORITY, self.data.get('existing_date_after_priority'))
|
||||
endfunction
|
||||
|
||||
function! s:tc.test_insert_with_existing_date_and_priority()
|
||||
let g:todo_existing_date = 'n'
|
||||
call self.data.execute('call todo#txt#prepend_date()', 'existing_date_do_nothing')
|
||||
call self.assert_equal(s:DATE_INSERTED_DO_NOTHING, self.data.get('existing_date_do_nothing'))
|
||||
unlet g:todo_existing_date
|
||||
endfunction
|
||||
|
||||
unlet s:tc
|
||||
|
||||
Reference in New Issue
Block a user