mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
colorfull!
This commit is contained in:
19
unittest.vim
19
unittest.vim
@@ -17,6 +17,14 @@ function! s:show_category(category)
|
|||||||
echo "\r"
|
echo "\r"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:show_pass(pass)
|
||||||
|
echohl Title | echo "pass".a:pass."\n" | echohl None
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:show_done()
|
||||||
|
echohl IncSearch | echo "done" | echohl None
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:escape(str)
|
function! s:escape(str)
|
||||||
let str = a:str
|
let str = a:str
|
||||||
let str = substitute(str, "\n", '\\n', 'g')
|
let str = substitute(str, "\n", '\\n', 'g')
|
||||||
@@ -27,7 +35,7 @@ endfunction
|
|||||||
function! s:show_title(no, title)
|
function! s:show_title(no, title)
|
||||||
let title = s:escape(a:title)
|
let title = s:escape(a:title)
|
||||||
let width = &columns - 23
|
let width = &columns - 23
|
||||||
echohl ModeMsg | echon "\rtesting #".printf("%03d", a:no)
|
echohl MoreMsg | echon "\rtesting #".printf("%03d", a:no)
|
||||||
echohl None | echon ": " . (len(title) < width ? (title.repeat(' ', width-len(title))) : strpart(title, 0, width)) . ' ... '
|
echohl None | echon ": " . (len(title) < width ? (title.repeat(' ', width-len(title))) : strpart(title, 0, width)) . ' ... '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -126,7 +134,7 @@ function! s:test(...)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
echo "past:".reltimestr(reltime(start))."\n"
|
call s:show_pass(reltimestr(reltime(start)))
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
@@ -137,11 +145,11 @@ function! s:do_tests(...)
|
|||||||
let s:old_user_zen_settings = g:user_zen_settings
|
let s:old_user_zen_settings = g:user_zen_settings
|
||||||
let g:user_zen_settings = { 'indentation': "\t" }
|
let g:user_zen_settings = { 'indentation': "\t" }
|
||||||
endif
|
endif
|
||||||
call s:reload(expand('<sfile>:h'))
|
|
||||||
let oldmore = &more
|
let oldmore = &more
|
||||||
|
call s:reload(fnamemodify(s:sfile, ':h'))
|
||||||
let &more = 0
|
let &more = 0
|
||||||
call call('s:test', a:000)
|
call call('s:test', a:000)
|
||||||
echo "done"
|
call s:show_done()
|
||||||
catch
|
catch
|
||||||
echoerr v:exception
|
echoerr v:exception
|
||||||
finally
|
finally
|
||||||
@@ -167,6 +175,9 @@ function! g:zencoding_unittest_complete(arglead, cmdline, cmdpos)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
command! -nargs=* -complete=customlist,g:zencoding_unittest_complete ZenCodingUnitTest call s:do_tests(<f-args>)
|
command! -nargs=* -complete=customlist,g:zencoding_unittest_complete ZenCodingUnitTest call s:do_tests(<f-args>)
|
||||||
|
if expand('<sfile>') == expand('%')
|
||||||
|
ZenCodingUnitTest
|
||||||
|
endif
|
||||||
|
|
||||||
finish
|
finish
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user