parent
69bf9ef519
commit
459904381b
@ -123,8 +123,13 @@ stack trace is loaded into the |location-list|. Use |:lopen| to view it.
|
|||||||
:RunTests [ns] [...] Call clojure.test/run-tests on the given namespaces
|
:RunTests [ns] [...] Call clojure.test/run-tests on the given namespaces
|
||||||
and load the results into the quickfix list.
|
and load the results into the quickfix list.
|
||||||
|
|
||||||
:RunAllTests [pattern] Call clojure.test/run-all-tests with the given pattern
|
:[range]RunTests Call clojure.test/test-var on the var defined at or
|
||||||
:0RunTests [pattern] and load the results into the quickfix list.
|
above the specicied line and load the results into the
|
||||||
|
quickfix list. Typically invoked as :.RunTests to run
|
||||||
|
the test under the cursor.
|
||||||
|
|
||||||
|
:0RunTests [pattern] Call clojure.test/run-all-tests with the given pattern
|
||||||
|
and load the results into the quickfix list.
|
||||||
|
|
||||||
*fireplace-cp*
|
*fireplace-cp*
|
||||||
cp{motion} Eval/print the code indicated by {motion}.
|
cp{motion} Eval/print the code indicated by {motion}.
|
||||||
|
@ -1596,11 +1596,33 @@ function! s:RunTests(bang, count, ...) abort
|
|||||||
let expr = '(clojure.test/run-all-tests)'
|
let expr = '(clojure.test/run-all-tests)'
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let reqs = map(copy(a:000), '"''".v:val')
|
if a:0 && a:000 !=# [fireplace#ns()]
|
||||||
let pre = '(clojure.core/require '.join(empty(a:000) ? ["'".fireplace#ns()] : reqs, ' ').' :reload) '
|
let args = a:000
|
||||||
let expr = join(['(clojure.test/run-tests'] + reqs, ' ').')'
|
else
|
||||||
|
let args = [fireplace#ns()]
|
||||||
|
if a:count
|
||||||
|
let pattern = '^\s*(def\k*\s\+\zs\h\k*'
|
||||||
|
let line = search(pattern, 'bWn')
|
||||||
|
if line
|
||||||
|
let args[0] .= '/' . matchstr(getline(line), pattern)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
let reqs = map(copy(args), '"''".v:val')
|
||||||
|
let pre = '(clojure.core/require '.substitute(join(reqs, ' '), '/\k\+', '', 'g').' :reload) '
|
||||||
|
let expr = []
|
||||||
|
let vars = filter(copy(reqs), 'v:val =~# "/"')
|
||||||
|
let nses = filter(copy(reqs), 'v:val !~# "/"')
|
||||||
|
if len(vars) == 1
|
||||||
|
call add(expr, '(clojure.test/test-var #' . vars[0] . ')')
|
||||||
|
elseif !empty(vars)
|
||||||
|
call add(expr, join(['(clojure.test/test-vars'] + map(vars, '"#".v:val'), ' ').')')
|
||||||
|
endif
|
||||||
|
if !empty(nses)
|
||||||
|
call add(expr, join(['(clojure.test/run-tests'] + nses, ' ').')')
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
call fireplace#capture_test_run(expr, pre)
|
call fireplace#capture_test_run(join(expr, ' '), pre)
|
||||||
echo expr
|
echo expr
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user