Testing date functions

This commit is contained in:
Leandro Freitas
2015-04-12 11:42:29 -03:00
parent 95ed508741
commit b8a5bd64ca
3 changed files with 52 additions and 1 deletions

View File

@@ -10,6 +10,12 @@ let s:save_cpo = &cpo
set cpo&vim
" Export Context Dictionary for unit testing {{{1
function! s:get_SID()
return matchstr(expand('<sfile>'), '<SNR>\d\+_')
endfunction
let s:SID = s:get_SID()
delfunction s:get_SID
function! todo#__context__()
return { 'sid': s:SID, 'scope': s: }
endfunction
@@ -26,8 +32,12 @@ function! s:TodoTxtRemovePriority()
:s/^(\w)\s\+//ge
endfunction
function! s:TodoTxtGetCurrentDate()
return strftime('%Y-%m-%d')
endfunction
function! TodoTxtPrependDate()
normal! 0"=strftime("%Y-%m-%d ")
execute 'normal! 0"='.string(s:TodoTxtGetCurrentDate().' ').'
P'
endfunction