106_errorformat_spec.lua 909 B

1234567891011121314151617181920212223242526
  1. -- Tests for errorformat.
  2. local helpers = require('test.functional.helpers')(after_each)
  3. local clear = helpers.clear
  4. local command, expect = helpers.command, helpers.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)