Testing functions only (not mappings).

This commit is contained in:
Leandro Freitas
2015-04-17 09:04:30 -03:00
parent e071156b8d
commit d0080e66f9
2 changed files with 4 additions and 6 deletions

View File

@@ -3,7 +3,6 @@ let s:context = todo#txt#__context__()
let s:context['data'] = s:here . '/tc_date.todo.txt' let s:context['data'] = s:here . '/tc_date.todo.txt'
let s:tc = unittest#testcase#new('Date', s:context) let s:tc = unittest#testcase#new('Date', s:context)
let s:LEADER = mapleader
let s:TODAY = strftime("%Y-%m-%d") let s:TODAY = strftime("%Y-%m-%d")
function! s:tc.test_current_date() function! s:tc.test_current_date()
@@ -20,7 +19,7 @@ let s:DATE_INSERTED_VISUAL = [
function! s:tc.test_insert_date_normal_mode() function! s:tc.test_insert_date_normal_mode()
call self.data.goto('lorem_ipsum') 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')) call self.assert_equal(s:DATE_INSERTED, self.data.get('lorem_ipsum'))
endfunction endfunction

View File

@@ -2,7 +2,6 @@ let s:here = expand('<sfile>:p:h')
let s:tc = unittest#testcase#new('Mask As Done', let s:tc = unittest#testcase#new('Mask As Done',
\ { 'data': s:here . '/tc_mark_as_done.todo.txt' }) \ { 'data': s:here . '/tc_mark_as_done.todo.txt' })
let s:LEADER = mapleader
let s:TODAY = strftime("%Y-%m-%d") let s:TODAY = strftime("%Y-%m-%d")
let s:FIRST_TASK_DONE = [ let s:FIRST_TASK_DONE = [
@@ -19,17 +18,17 @@ let s:ALL_TASKS_DONE = [
function! s:tc.test_mark_as_done() function! s:tc.test_mark_as_done()
call self.data.goto('lorem_ipsum') 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')) call self.assert_equal(s:FIRST_TASK_DONE, self.data.get('lorem_ipsum'))
endfunction endfunction
function! s:tc.test_mark_range_as_done() 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')) call self.assert_equal(s:ALL_TASKS_DONE, self.data.get('lorem_ipsum'))
endfunction endfunction
function! s:tc.test_mark_selection_as_done() 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')) call self.assert_equal(s:ALL_TASKS_DONE, self.data.get('lorem_ipsum'))
endfunction endfunction