make_spec.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. local helpers = require('test.functional.helpers')(after_each)
  2. local clear = helpers.clear
  3. local eval = helpers.eval
  4. local has_powershell = helpers.has_powershell
  5. local matches = helpers.matches
  6. local nvim = helpers.nvim
  7. local testprg = helpers.testprg
  8. describe(':make', function()
  9. clear()
  10. before_each(function ()
  11. clear()
  12. end)
  13. describe('with powershell', function()
  14. if not has_powershell() then
  15. pending("not tested; powershell was not found", function() end)
  16. return
  17. end
  18. before_each(function ()
  19. helpers.set_shell_powershell()
  20. end)
  21. it('captures stderr & non zero exit code #14349', function ()
  22. nvim('set_option', 'makeprg', testprg('shell-test')..' foo')
  23. local out = eval('execute("make")')
  24. -- Make program exit code correctly captured
  25. matches('\nshell returned 3', out)
  26. -- Error message is captured in the file and printed in the footer
  27. matches('\n.*%: Unknown first argument%: foo', out)
  28. end)
  29. it('captures stderr & zero exit code #14349', function ()
  30. nvim('set_option', 'makeprg', testprg('shell-test'))
  31. local out = eval('execute("make")')
  32. -- Ensure there are no "shell returned X" messages between
  33. -- command and last line (indicating zero exit)
  34. matches('LastExitCode%s+ready [$]%s+[(]', out)
  35. matches('\n.*%: ready [$]', out)
  36. end)
  37. end)
  38. end)