comparison src/testdir/vim9.vim @ 26686:c04b28fad0cc v8.2.3872

patch 8.2.3872: Vim9: finddir() and uniq() return types can be more specific Commit: https://github.com/vim/vim/commit/080182216e605df3428cc699b9fd7e761368d12f Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 22 18:45:37 2021 +0000 patch 8.2.3872: Vim9: finddir() and uniq() return types can be more specific Problem: Vim9: finddir() and uniq() return types can be more specific. Solution: Adjust the return type.
author Bram Moolenaar <Bram@vim.org>
date Wed, 22 Dec 2021 20:00:04 +0100
parents e01607ab0fab
children 4c16acb2525f
comparison
equal deleted inserted replaced
26685:c5be20c42849 26686:c04b28fad0cc
1 " Utility functions for testing vim9 script 1 " Utility functions for testing vim9 script
2 2
3 " Use a different file name for each run. 3 " Use a different file name for each run.
4 let s:sequence = 1 4 let s:sequence = 1
5 5
6 " Check that "lines" inside a ":def" function has no error. 6 " Check that "lines" inside a ":def" function has no error when called.
7 func CheckDefSuccess(lines) 7 func CheckDefSuccess(lines)
8 let cwd = getcwd() 8 let cwd = getcwd()
9 let fname = 'XdefSuccess' .. s:sequence 9 let fname = 'XdefSuccess' .. s:sequence
10 let s:sequence += 1 10 let s:sequence += 1
11 call writefile(['def Func()'] + a:lines + ['enddef', 'defcompile'], fname) 11 call writefile(['def Func()'] + a:lines + ['enddef', 'defcompile'], fname)
12 try 12 try
13 exe 'so ' .. fname 13 exe 'so ' .. fname
14 call Func() 14 call Func()
15 finally 15 finally
16 call chdir(cwd) 16 call chdir(cwd)
17 call delete(fname)
18 delfunc! Func
19 endtry
20 endfunc
21
22 " Check that "lines" inside a ":def" function has no error when compiled.
23 func CheckDefCompileSuccess(lines)
24 let fname = 'XdefSuccess' .. s:sequence
25 let s:sequence += 1
26 call writefile(['def Func()'] + a:lines + ['enddef', 'defcompile'], fname)
27 try
28 exe 'so ' .. fname
29 finally
17 call delete(fname) 30 call delete(fname)
18 delfunc! Func 31 delfunc! Func
19 endtry 32 endtry
20 endfunc 33 endfunc
21 34