diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-15 20:47:04 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-15 21:06:17 +0800 |
commit | c5ec823a14f88a1d5ea1872f39fdabd85af1e81c (patch) | |
tree | 792746c9ad40cf182d26c8d47cc1225885de5e8e /test | |
parent | e9b4f5105100ce2279915bbe1d67d299c294db24 (diff) | |
download | rneovim-c5ec823a14f88a1d5ea1872f39fdabd85af1e81c.tar.gz rneovim-c5ec823a14f88a1d5ea1872f39fdabd85af1e81c.tar.bz2 rneovim-c5ec823a14f88a1d5ea1872f39fdabd85af1e81c.zip |
vim-patch:9.0.1431: getscriptinfo() loops even when specific SID is given
Problem: getscriptinfo() loops even when specific SID is given.
Solution: Only loop when needed. Give a clearer error message.
(closes vim/vim#12207)
https://github.com/vim/vim/commit/2d68b722e3bca7532eb0d83ce773934618f12db5
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_scriptnames.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/old/testdir/test_scriptnames.vim b/test/old/testdir/test_scriptnames.vim index 33b00e2505..69e5e526fd 100644 --- a/test/old/testdir/test_scriptnames.vim +++ b/test/old/testdir/test_scriptnames.vim @@ -93,6 +93,16 @@ func Test_getscriptinfo() call assert_fails("echo getscriptinfo('foobar')", 'E1206:') call assert_fails("echo getscriptinfo({'sid': []})", 'E745:') + call assert_fails("echo getscriptinfo({'sid': {}})", 'E728:') + call assert_fails("echo getscriptinfo({'sid': 0})", 'E475:') + call assert_fails("echo getscriptinfo({'sid': -1})", 'E475:') + call assert_fails("echo getscriptinfo({'sid': -999})", 'E475:') + + echo getscriptinfo({'sid': '1'}) + " call assert_fails("vim9cmd echo getscriptinfo({'sid': '1'})", 'E1030:') + + let max_sid = max(map(getscriptinfo(), { k, v -> v.sid })) + call assert_equal([], getscriptinfo({'sid': max_sid + 1})) call delete('X22script91') endfunc |