mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-17 14:23:39 -05:00
Fixes #37. Replacing existing priority
This commit is contained in:
28
test/tc_priority.vim
Normal file
28
test/tc_priority.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
let s:here = expand('<sfile>:p:h')
|
||||
let s:context = todo#txt#__context__()
|
||||
let s:context['data'] = s:here . '/tc_priority.todo.txt'
|
||||
let s:tc = unittest#testcase#new('Priority', s:context)
|
||||
|
||||
let s:TODAY = strftime("%Y-%m-%d")
|
||||
|
||||
let s:PRIORITY_INSERTED = [
|
||||
\ '(A) example task',
|
||||
\ ]
|
||||
|
||||
let s:PRIORITY_REPLACED = [
|
||||
\ '(C) example task',
|
||||
\ ]
|
||||
|
||||
function! s:tc.test_insert_priority()
|
||||
call self.data.goto('insert_priority')
|
||||
call todo#txt#prioritize_add('A')
|
||||
call self.assert_equal(s:PRIORITY_INSERTED, self.data.get('insert_priority'))
|
||||
endfunction
|
||||
|
||||
function! s:tc.test_replace_priority()
|
||||
call self.data.goto('replace_priority')
|
||||
call todo#txt#prioritize_add('C')
|
||||
call self.assert_equal(s:PRIORITY_REPLACED, self.data.get('replace_priority'))
|
||||
endfunction
|
||||
|
||||
unlet s:tc
|
||||
Reference in New Issue
Block a user