summaryrefslogtreecommitdiffstats
path: root/src/testdir/shared.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-23 00:50:15 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-23 00:50:15 +0200
commit7a39dd7f00239059ce34660611589b26126a550c (patch)
tree6b8b1b7c7218f0f213804cd84c0859d9e0f23b87 /src/testdir/shared.vim
parentc662ec9978e9a381680ffe53d05da0e10bb8d1a0 (diff)
patch 8.1.1581: shared functions for testing are disorganisedv8.1.1581
Problem: Shared functions for testing are disorganised. Solution: Group finctions in script files. (Ozaki Kiichi, closes #4573)
Diffstat (limited to 'src/testdir/shared.vim')
-rw-r--r--src/testdir/shared.vim32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim
index ae023a73b9..53b7314673 100644
--- 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