From 7e1d9c560b09cacb78b2fc8f9428a77d6fca66e1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Nov 2022 07:21:46 +0800 Subject: vim-patch:8.2.2873: not enough tests for writing buffers Problem: Not enough tests for writing buffers. Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8229) https://github.com/vim/vim/commit/46aa6f93acb5d932d2893606d980a6b4b8a9594c Co-authored-by: Yegappan Lakshmanan --- src/nvim/testdir/test_cmdline.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/nvim/testdir/test_cmdline.vim') diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 7cef3117c2..b0be7ab396 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -1513,6 +1513,7 @@ func Test_cmdline_expand_special() call assert_fails('e ', 'E495:') call assert_fails('e ', 'E496:') call assert_fails('e ', 'E497:') + call writefile([], 'Xfile.cpp') call writefile([], 'Xfile.java') new Xfile.cpp @@ -2006,6 +2007,26 @@ func Test_recalling_cmdline() cunmap (save-cmdline) endfunc +" Test for the 'suffixes' option +func Test_suffixes_opt() + call writefile([], 'Xfile') + call writefile([], 'Xfile.c') + call writefile([], 'Xfile.o') + set suffixes= + call feedkeys(":e Xfi*\\\"\", 'xt') + call assert_equal('"e Xfile Xfile.c Xfile.o', @:) + set suffixes=.c + call feedkeys(":e Xfi*\\\"\", 'xt') + call assert_equal('"e Xfile Xfile.o Xfile.c', @:) + set suffixes=,, + call feedkeys(":e Xfi*\\\"\", 'xt') + call assert_equal('"e Xfile.c Xfile.o Xfile', @:) + set suffixes& + call delete('Xfile') + call delete('Xfile.c') + call delete('Xfile.o') +endfunc + " Test for using a popup menu for the command line completion matches " (wildoptions=pum) func Test_wildmenu_pum() -- cgit