diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-07 21:17:13 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-12 17:16:34 +0100 |
commit | 1918638c673e5c081bf063617ae69facd82c30d9 (patch) | |
tree | 13033c7c11dfddb99442b37dd842b7124e5d0636 /src | |
parent | e0bdc9b89c336a15e77639eef1c9087808292f36 (diff) | |
download | rneovim-1918638c673e5c081bf063617ae69facd82c30d9.tar.gz rneovim-1918638c673e5c081bf063617ae69facd82c30d9.tar.bz2 rneovim-1918638c673e5c081bf063617ae69facd82c30d9.zip |
test(oldtest): cherry-pick needed test functions from v8.1.1336
Cherry-pick Test_call() and Test_cindent_func().
Required for v8.1.1911 and v8.1.1915.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_cindent.vim | 10 | ||||
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cindent.vim b/src/nvim/testdir/test_cindent.vim index b6c2d1467e..c8b7d90fbb 100644 --- a/src/nvim/testdir/test_cindent.vim +++ b/src/nvim/testdir/test_cindent.vim @@ -118,6 +118,16 @@ b = something(); bw! endfunc +func Test_cindent_func() + new + setlocal cindent + call setline(1, ['int main(void)', '{', 'return 0;', '}']) + call assert_equal(cindent(0), -1) + call assert_equal(cindent(3), &sw) + call assert_equal(cindent(line('$')+1), -1) + bwipe! +endfunc + " this was going beyond the end of the line. func Test_cindent_case() new diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 48f97be96b..612b72cb62 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1473,6 +1473,18 @@ func Test_readdir() call delete('Xdir', 'rf') endfunc +func Test_call() + call assert_equal(3, call('len', [123])) + call assert_fails("call call('len', 123)", 'E714:') + call assert_equal(0, call('', [])) + + function Mylen() dict + return len(self.data) + endfunction + let mydict = {'data': [0, 1, 2, 3], 'len': function("Mylen")} + call assert_fails("call call('Mylen', [], 0)", 'E715:') +endfunc + " Test for the eval() function func Test_eval() call assert_fails("call eval('5 a')", 'E488:') |