From d78b041fd09c5c4020e85ab37dbfe30ec82ce90e Mon Sep 17 00:00:00 2001 From: mattn Date: Tue, 16 Mar 2010 22:09:37 +0900 Subject: [PATCH] stop at failing test. --- unittest.vim | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/unittest.vim b/unittest.vim index 241d4f6..1e3c9b5 100644 --- a/unittest.vim +++ b/unittest.vim @@ -1,13 +1,14 @@ -so zencoding.vim if exists('g:user_zen_settings') let s:old_user_zen_settings = g:user_zen_settings unlet! g:user_zen_settings endif +so zencoding.vim unlet! testgroups -let oldmore=&more -let &more=0 +let oldmore = &more +let &more = 0 let testgroups = eval(join(filter(split(substitute(join(readfile(expand('')), "\n"), '.*\nfinish\n', '', ''), '\n', 1), "v:val !~ '^\"'"))) +let failed = 0 for testgroup in testgroups echohl MatchParen | echon "[" testgroup.category."]\n" | echohl None let tests = testgroup.tests @@ -23,11 +24,16 @@ for testgroup in testgroups else echohl WarningMsg | echon "ng\n" | echohl None echohl ErrorMsg | echo "failed test #".(n+1) | echohl None - echo " expect:".tests[n].result - echo " got:".res - echo "" + echo " expect:".tests[n].result + echo " got:".res + echo "" + let failed = 1 + break endif endfor + if failed + break + endif echo "past:".reltimestr(reltime(start))."\n" endfor