edit_spec.lua 752 B

12345678910111213141516171819202122232425262728293031
  1. local t = require('test.testutil')
  2. local n = require('test.functional.testnvim')()
  3. local eq, command, fn = t.eq, n.command, n.fn
  4. local ok = t.ok
  5. local matches = t.matches
  6. local clear = n.clear
  7. local feed = n.feed
  8. describe(':edit', function()
  9. before_each(function()
  10. clear()
  11. end)
  12. it('without arguments does not restart :terminal buffer', function()
  13. command('terminal')
  14. feed([[<C-\><C-N>]])
  15. local bufname_before = fn.bufname('%')
  16. local bufnr_before = fn.bufnr('%')
  17. matches('^term://', bufname_before) -- sanity
  18. command('edit')
  19. local bufname_after = fn.bufname('%')
  20. local bufnr_after = fn.bufnr('%')
  21. ok(fn.line('$') > 1)
  22. eq(bufname_before, bufname_after)
  23. eq(bufnr_before, bufnr_after)
  24. end)
  25. end)