From d0080e66f93bcc41e2381a961b40e66a9ec573c7 Mon Sep 17 00:00:00 2001 From: Leandro Freitas Date: Fri, 17 Apr 2015 09:04:30 -0300 Subject: [PATCH] Testing functions only (not mappings). --- test/tc_date.vim | 3 +-- test/tc_mark_as_done.vim | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/tc_date.vim b/test/tc_date.vim index 5da0b4b..9da7349 100644 --- a/test/tc_date.vim +++ b/test/tc_date.vim @@ -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 diff --git a/test/tc_mark_as_done.vim b/test/tc_mark_as_done.vim index f397df8..6328a9c 100644 --- a/test/tc_mark_as_done.vim +++ b/test/tc_mark_as_done.vim @@ -2,7 +2,6 @@ let s:here = expand(':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