diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2025-01-07 09:05:52 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2025-01-07 09:15:10 +0800 |
| commit | 8fa4306eb910028ee8df8685ae9b1649608c2608 (patch) | |
| tree | eb2a65a2b975f9fcc56e41ee1db6fde66b58d3dd /test | |
| parent | d5308637bf1aac2b97fccf73a0ffdef304eaa1d6 (diff) | |
| download | rneovim-8fa4306eb910028ee8df8685ae9b1649608c2608.tar.gz rneovim-8fa4306eb910028ee8df8685ae9b1649608c2608.tar.bz2 rneovim-8fa4306eb910028ee8df8685ae9b1649608c2608.zip | |
vim-patch:9.1.0991: v:stacktrace has wrong type in Vim9 script
Problem: v:stacktrace has wrong type in Vim9 script.
Solution: Change the type to t_list_dict_any. Fix grammar in docs.
(zeertzjq)
closes: vim/vim#16390
https://github.com/vim/vim/commit/6655bef33047b826e0ccb8c686f3f57e47161b1c
Diffstat (limited to 'test')
| -rw-r--r-- | test/old/testdir/test_stacktrace.vim | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/test/old/testdir/test_stacktrace.vim b/test/old/testdir/test_stacktrace.vim index 2ff5801ce6..1e47deefdd 100644 --- a/test/old/testdir/test_stacktrace.vim +++ b/test/old/testdir/test_stacktrace.vim @@ -1,5 +1,7 @@ " Test for getstacktrace() and v:stacktrace +source vim9.vim + let s:thisfile = expand('%:p') let s:testdir = s:thisfile->fnamemodify(':h') @@ -34,7 +36,7 @@ func Test_getstacktrace() source Xscript1 call Xfunc1() call AssertStacktrace([ - \ #{funcref: funcref('Test_getstacktrace'), lnum: 35, filepath: s:thisfile}, + \ #{funcref: funcref('Test_getstacktrace'), lnum: 37, filepath: s:thisfile}, \ #{funcref: funcref('Xfunc1'), lnum: 5, filepath: Filepath('Xscript1')}, \ #{funcref: funcref('Xfunc2'), lnum: 4, filepath: Filepath('Xscript2')}, \ ], g:stacktrace) @@ -61,7 +63,7 @@ func Test_getstacktrace_event() source Xscript1 source Xscript2 call AssertStacktrace([ - \ #{funcref: funcref('Test_getstacktrace_event'), lnum: 62, filepath: s:thisfile}, + \ #{funcref: funcref('Test_getstacktrace_event'), lnum: 64, filepath: s:thisfile}, \ #{event: 'SourcePre Autocommands for "*"', lnum: 7, filepath: Filepath('Xscript1')}, \ #{funcref: funcref('Xfunc'), lnum: 4, filepath: Filepath('Xscript1')}, \ ], g:stacktrace) @@ -98,10 +100,33 @@ func Test_vstacktrace() endtry call assert_equal([], v:stacktrace) call AssertStacktrace([ - \ #{funcref: funcref('Test_vstacktrace'), lnum: 95, filepath: s:thisfile}, + \ #{funcref: funcref('Test_vstacktrace'), lnum: 97, filepath: s:thisfile}, \ #{funcref: funcref('Xfunc1'), lnum: 5, filepath: Filepath('Xscript1')}, \ #{funcref: funcref('Xfunc2'), lnum: 4, filepath: Filepath('Xscript2')}, \ ], stacktrace) endfunc +func Test_zzz_stacktrace_vim9() + let lines =<< trim [SCRIPT] + var stacktrace = getstacktrace() + assert_notequal([], stacktrace) + for d in stacktrace + assert_true(has_key(d, 'lnum')) + endfor + try + throw 'Exception from s:Func' + catch + assert_notequal([], v:stacktrace) + assert_equal(len(stacktrace), len(v:stacktrace)) + for d in v:stacktrace + assert_true(has_key(d, 'lnum')) + endfor + endtry + [SCRIPT] + call CheckDefSuccess(lines) + " FIXME: v:stacktrace is not cleared after the exception handling, and this + " test has to be run as the last one because of this. + " call assert_equal([], v:stacktrace) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |