neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

106_errorformat_spec.lua (877B)


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