I found a nifty thing that I hadn't thought of before, using gq
to reformat a hard to read test diff in the REPL output buffer:
[Olical/conjure] Issue opened by Olical
Does anyone have tips for jumping to the location of failed tests? My idea would be to somehow load the filename and line number into the quickfix-list, but not sure on how to access the output buffer to do it
If anyone is interested, here is my quick hack for loading the errors into the quickfix list
exe bufwinnr('conjure-log-') . "wincmd w"
let l:lines = getline(search("^; Testing ", 'bn'), '$')
let l:lines_fail = filter(deepcopy(l:lines), { key, val -> val =~ '^; FAIL in' })
let l:lines_expect = filter(deepcopy(l:lines), { key, val -> val =~ '^; expected:' })
let l:lines_actual = filter(deepcopy(l:lines), { key, val -> val =~ '^; actual:' })
let l:lines_fail = map(l:lines_fail, { key, val-> join(split(split(split(split(val)[4], "(")[0], ")")[0], ":")[0:2], ":") })
let l:lines_expect = map(l:lines_expect, { key, val-> split(val, "; ")[0]})
let l:lines_actual = map(l:lines_actual, { key, val-> split(val, "; ")[0]})
let l:lines_join = map(l:lines_fail, { key, val-> val . ":" . l:lines_expect[key] . " " . l:lines_actual[key]})
cgetexpr l:lines_join
wincmd p
copen
please dont shoot me, vimscript is hard