conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
emilaasa 2021-06-04T09:53:59.125400Z

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:

💯 1
👀 2
2021-06-04T10:30:47.125800Z

[Olical/conjure] Issue opened by Olical

Sigve 2021-06-04T11:52:17.127900Z

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

Sigve 2021-06-04T14:49:08.129600Z

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