robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
966 B28 linesraw
1-- Tests for errorformat.
2
3local n = require('test.functional.testnvim')()
4local t = require('test.testutil')
5
6local describe, it, setup = t.describe, t.it, t.setup
7local clear = n.clear
8local command, expect = n.command, n.expect
9
10describe('errorformat', function()
11  setup(clear)
12
13  it('is working', function()
14    command('set efm=%EEEE%m,%WWWW%m,%+CCCC%.%#,%-GGGG%.%#')
15    command("cgetexpr ['WWWW', 'EEEE', 'CCCC']")
16    command("$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))")
17    command("cgetexpr ['WWWW', 'GGGG', 'EEEE', 'CCCC']")
18    command("$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))")
19    command("cgetexpr ['WWWW', 'GGGG', 'ZZZZ', 'EEEE', 'CCCC', 'YYYY']")
20    command("$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))")
21
22    expect([=[
23
24      [['W', 1], ['E^@CCCC', 1]]
25      [['W', 1], ['E^@CCCC', 1]]
26      [['W', 1], ['ZZZZ', 0], ['E^@CCCC', 1], ['YYYY', 0]]]=])
27  end)
28end)