106_errorformat_spec.lua 877 B

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