diff src/testdir/shared.vim @ 17164:7927cf327396 v8.1.1581

patch 8.1.1581: shared functions for testing are disorganised commit https://github.com/vim/vim/commit/7a39dd7f00239059ce34660611589b26126a550c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 23 00:50:15 2019 +0200 patch 8.1.1581: shared functions for testing are disorganised Problem: Shared functions for testing are disorganised. Solution: Group finctions in script files. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/4573)
author Bram Moolenaar <Bram@vim.org>
date Sun, 23 Jun 2019 01:00:05 +0200
parents f38fcbf343ce
children 3e2e998ce0db
line wrap: on
line diff
--- a/src/testdir/shared.vim
+++ b/src/testdir/shared.vim
@@ -1,10 +1,12 @@
 " Functions shared by several tests.
 
 " Only load this script once.
-if exists('*WaitFor')
+if exists('*PythonProg')
   finish
 endif
 
+source view_util.vim
+
 " Get the name of the Python executable.
 " Also keeps it in s:python.
 func PythonProg()
@@ -327,31 +329,3 @@ func WorkingClipboard()
   endif
   return 1
 endfunc
-
-" Get line "lnum" as displayed on the screen.
-" Trailing white space is trimmed.
-func Screenline(lnum)
-  let chars = []
-  for c in range(1, winwidth(0))
-    call add(chars, nr2char(screenchar(a:lnum, c)))
-  endfor
-  let line = join(chars, '')
-  return matchstr(line, '^.\{-}\ze\s*$')
-endfunc
-
-" Stops the shell running in terminal "buf".
-func Stop_shell_in_terminal(buf)
-  call term_sendkeys(a:buf, "exit\r")
-  let job = term_getjob(a:buf)
-  call WaitFor({-> job_status(job) == "dead"})
-endfunc
-
-" Gets the text of a terminal line, using term_scrape()
-func Get_terminal_text(bufnr, row)
-  let list = term_scrape(a:bufnr, a:row)
-  let text = ''
-  for item in list
-    let text .= item.chars
-  endfor
-  return text
-endfunc