From eecca8563ac18ae75fd802b9440666b1ab80a18c Mon Sep 17 00:00:00 2001 From: haya14busa Date: Sat, 29 Mar 2014 19:46:49 +0900 Subject: [PATCH] Fix test script --- t/easymotion_spec.vim | 6 ++--- t/smartsign_spec.vim | 60 ++++++++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/t/easymotion_spec.vim b/t/easymotion_spec.vim index afa621d..0f4f434 100644 --- a/t/easymotion_spec.vim +++ b/t/easymotion_spec.vim @@ -28,9 +28,9 @@ "============================================================================= " Avoid source test files {{{ -if expand("%:p") ==# expand(":p") - finish -endif +" if expand("%:p") ==# expand(":p") +" finish +" endif "}}} let s:root_dir = matchstr(system('git rev-parse --show-cdup'), '[^\n]\+') diff --git a/t/smartsign_spec.vim b/t/smartsign_spec.vim index bcac271..3c31a33 100644 --- a/t/smartsign_spec.vim +++ b/t/smartsign_spec.vim @@ -27,9 +27,9 @@ " Test for `smartsign` feature for find motions " Avoid source test files {{{ -if expand("%:p") ==# expand(":p") - finish -endif +" if expand("%:p") ==# expand(":p") +" finish +" endif "}}} " Setup {{{ @@ -50,21 +50,14 @@ endfunction " Smartsign configulation {{{ describe 'Smartsign configulation' - before - new - end - - after - close! - end - it 'provide default dictionary' let smartdict_us = g:EasyMotion#sticky_table#us let smartdict_jp = g:EasyMotion#sticky_table#jp Expect smartdict_us !=# {} Expect smartdict_jp !=# {} end -end "}}} +end +"}}} " Basic Smartsign feature with 1-key findmotions with US layout {{{ describe 'Basic Smartsign feature with 1-key findmotions with US layout' @@ -390,7 +383,8 @@ describe 'Basic Smartsign feature with 1-key findmotions with US layout' Expect CursorPos() == [l+2,1,' '] normal! 0 end -end "}}} +end +"}}} " Smartsign with 2-key find motions with JP layout {{{ describe 'Smartsign with 2-key find motions with JP layout' @@ -398,11 +392,14 @@ describe 'Smartsign with 2-key find motions with JP layout' new let g:EasyMotion_keys = '123456789' let g:EasyMotion_use_smartsign_jp = 1 - map s2 (easymotion-s2) + map s (easymotion-s2) call EasyMotion#init() call AddLine(' -= ^~ ;+ :* [{ ]} @` \|') call AddLine(' 1! 2" 3# 4$ 5% 6& 7'' 8( 9) 0_') call AddLine(' ,< .> /?') + call AddLine(' -= ^~ ;+ :* [{ ]} @` \|') + call AddLine(' 1! 2" 3# 4$ 5% 6& 7'' 8( 9) 0_') + call AddLine(' ,< .> /?') " 123456789012345678901234567890 " 1 2 3 " @@ -427,13 +424,11 @@ describe 'Smartsign with 2-key find motions with JP layout' normal s,,1 Expect CursorPos() == [l,2,','] normal! 0 - normal s,,2 + Expect CursorPos() == [l,1,' '] + normal s,,3 Expect CursorPos() == [l,1,' '] normal! 0 - normal s ,1 - Expect CursorPos() == [l,1,' '] - normal! 0 - normal s, 2 + normal s, 1 Expect CursorPos() == [l,3,'<'] normal! 0 normal s<<1 @@ -446,7 +441,16 @@ describe 'Smartsign with 2-key find motions with JP layout' Expect CursorPos() == [l,1,' '] normal! 0 end -end "}}} + it ': s,,3' + normal! 0 + let l = line('.') + Expect CursorPos() == [l,1,' '] + normal s,,3 + Expect CursorPos() == [l,1,' '] + normal! 0 + end +end +"}}} " Smartsign with n-key find search motions {{{ describe 'Smartsign with n-key find search motions' @@ -454,11 +458,14 @@ describe 'Smartsign with n-key find search motions' new let g:EasyMotion_keys = '123456789' let g:EasyMotion_use_smartsign_jp = 1 - map s2 (easymotion-s2) + map / (easymotion-sn) call EasyMotion#init() call AddLine(' -= ^~ ;+ :* [{ ]} @` \|') call AddLine(' 1! 2" 3# 4$ 5% 6& 7'' 8( 9) 0_') call AddLine(' ,< .> /?') + call AddLine(' -= ^~ ;+ :* [{ ]} @` \|') + call AddLine(' 1! 2" 3# 4$ 5% 6& 7'' 8( 9) 0_') + call AddLine(' ,< .> /?') end after @@ -472,14 +479,15 @@ describe 'Smartsign with n-key find search motions' Expect CursorPos() == [l,1,' '] " ,< - normal s,,1 - Expect CursorPos() != [l,2,','] + normal /,,1 + Expect CursorPos() == [l,1,' '] normal! 0 - normal s,<1 - Expect CursorPos() == [l,2,','] + normal /,<1 + Expect CursorPos() == [l,1,' '] normal! 0 end -end "}}} +end +"}}} " __END__ {{{ " vim: expandtab softtabstop=4 shiftwidth=4