patch 8.2.2684: not enough folding code is tested

Problem:    Not enough folding code is tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes #8046)
diff --git a/src/testdir/test_source.vim b/src/testdir/test_source.vim
index b22e57c..559208a 100644
--- a/src/testdir/test_source.vim
+++ b/src/testdir/test_source.vim
@@ -1,5 +1,8 @@
 " Tests for the :source command.
 
+source check.vim
+source view_util.vim
+
 func Test_source_autocmd()
   call writefile([
 	\ 'let did_source = 1',
@@ -93,4 +96,18 @@
   call assert_fails('scriptversion 2', 'E984:')
 endfunc
 
+" Test for sourcing a script recursively
+func Test_nested_script()
+  CheckRunVimInTerminal
+  call writefile([':source! Xscript.vim', ''], 'Xscript.vim')
+  let buf = RunVimInTerminal('', {'rows': 6})
+  call term_wait(buf)
+  call term_sendkeys(buf, ":set noruler\n")
+  call term_sendkeys(buf, ":source! Xscript.vim\n")
+  call term_wait(buf)
+  call WaitForAssert({-> assert_match('E22: Scripts nested too deep\s*', term_getline(buf, 6))})
+  call delete('Xscript.vim')
+  call StopVimInTerminal(buf)
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab