aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-14 07:07:32 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-08-15 10:14:53 +0800
commited65724e57d2af13cedc380ecfe4a495dae3afb7 (patch)
tree377f8659f94e379c12e3db944680375aeed2ef3c /src/nvim/testdir
parent98ab0bb5f7d2138be0b6019769e237e42aafad1a (diff)
downloadrneovim-ed65724e57d2af13cedc380ecfe4a495dae3afb7.tar.gz
rneovim-ed65724e57d2af13cedc380ecfe4a495dae3afb7.tar.bz2
rneovim-ed65724e57d2af13cedc380ecfe4a495dae3afb7.zip
vim-patch:8.2.1653: expand('<stack>') does not include the final line number
Problem: Expand('<stack>') does not include the final line number. Solution: Add the line nuber. (closes vim/vim#6927) https://github.com/vim/vim/commit/4f25b1aba050b85fa97ca2316aa04dd4b0b22530
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_expand_func.vim9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/testdir/test_expand_func.vim b/src/nvim/testdir/test_expand_func.vim
index 388620f87e..3094aad3a4 100644
--- a/src/nvim/testdir/test_expand_func.vim
+++ b/src/nvim/testdir/test_expand_func.vim
@@ -39,9 +39,9 @@ endfunc
func Test_expand_sfile_and_stack()
call assert_match('test_expand_func\.vim$', s:sfile)
- let expected = 'script .*testdir/runtest.vim\[\d\+\]\.\.function RunTheTest\[\d\+\]\.\.Test_expand_sfile_and_stack$'
- call assert_match(expected , expand('<sfile>'))
- call assert_match(expected , expand('<stack>'))
+ let expected = 'script .*testdir/runtest.vim\[\d\+\]\.\.function RunTheTest\[\d\+\]\.\.Test_expand_sfile_and_stack'
+ call assert_match(expected .. '$', expand('<sfile>'))
+ call assert_match(expected .. '\[4\]' , expand('<stack>'))
" Call in script-local function
call assert_match('script .*testdir/runtest.vim\[\d\+\]\.\.function RunTheTest\[\d\+\]\.\.Test_expand_sfile_and_stack\[7\]\.\.<SNR>\d\+_expand_sfile$', s:expand_sfile())
@@ -53,11 +53,12 @@ func Test_expand_sfile_and_stack()
" Use <stack> from sourced script.
let lines =<< trim END
+ " comment here
let g:stack_value = expand('<stack>')
END
call writefile(lines, 'Xstack')
source Xstack
- call assert_match('\<Xstack$', g:stack_value)
+ call assert_match('\<Xstack\[2\]', g:stack_value)
call delete('Xstack')
endfunc