source_spec.lua 842 B

123456789101112131415161718192021222324252627282930
  1. local t = require('test.testutil')
  2. local n = require('test.functional.testnvim')()
  3. local Screen = require('test.functional.ui.screen')
  4. local clear = n.clear
  5. local feed = n.feed
  6. local write_file = t.write_file
  7. before_each(clear)
  8. describe(':source!', function()
  9. -- oldtest: Test_nested_script()
  10. it('gives E22 when scripts nested too deep', function()
  11. write_file(
  12. 'Xscript.vim',
  13. [[
  14. :source! Xscript.vim
  15. ]]
  16. )
  17. local screen = Screen.new(75, 6)
  18. feed(':source! Xscript.vim\n')
  19. screen:expect([[
  20. ^ |
  21. {1:~ }|*4
  22. {9:E22: Scripts nested too deep} |
  23. ]])
  24. os.remove('Xscript.vim')
  25. end)
  26. end)