vim/src/testdir
Shougo Matsushita 9f860a14c3
patch 9.1.0883: message history cleanup is missing some tests
Problem:  message history cleanup is missing some tests
Solution: Add tests, refactor common code into did_set_msghistory()
          (Shougo Matsushita)

closes: #16078

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Milly <milly.ca@gmail.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-24 13:48:05 +01:00
..
crash patch 9.1.0701: crash with NFA regex engine when searching for composing chars 2024-08-28 23:17:52 +02:00
dumps patch 9.1.0855: setting 'cmdheight' may cause hit-enter-prompt 2024-11-11 21:48:30 +01:00
python2
python3
python_after
python_before
pythonx
pyxfile
ru_RU/LC_MESSAGES patch 9.1.0509: not possible to translate Vim script messages 2024-06-20 23:41:59 +02:00
samples patch 9.1.0834: tests: 2html test fails 2024-11-03 09:19:14 +01:00
sautest/autoload
testluaplugin/lua/testluaplugin
amiga.vim
check.vim
color_ramp.vim
commondumps.vim patch 9.1.0807: tests: having 'nolist' in modelines isn't always desired 2024-10-22 23:11:27 +02:00
dos.vim patch 9.1.0794: tests: tests may fail on Windows environment 2024-10-20 11:06:00 +02:00
dotest.in
gen_opt_test.vim patch 9.1.0864: message history is fixed to 200 2024-11-14 22:34:24 +01:00
gui_init.vim
gui_preinit.vim
keycode_check.json
keycode_check.vim
lsan-suppress.txt
Make_all.mak patch 9.1.0859: several problems with the GLVS plugin 2024-11-12 20:23:41 +01:00
Make_amiga.mak
Make_dos.mak
Make_ming.mak patch 9.1.0797: testing of options can be further improved 2024-10-21 22:20:51 +02:00
Make_mvc.mak patch 9.1.0797: testing of options can be further improved 2024-10-21 22:20:51 +02:00
Make_vms.mms
Makefile patch 9.1.0816: tests: not clear what tests cause asan failures 2024-10-27 21:15:50 +01:00
mouse.vim
popupbounce.vim
README.txt patch 9.1.0681: tests: Analyzing failed screendumps is hard 2024-08-19 21:33:26 +02:00
runtest.vim patch 9.1.0833: CI: recent ASAN changes do not work for indent tests 2024-11-03 09:15:35 +01:00
screendump.vim patch 9.1.0820: tests: Mac OS tests are too flaky 2024-10-28 21:56:50 +01:00
script_util.vim runtime(misc): Use consistent "Vim script" spelling 2024-10-13 19:16:42 +02:00
setup.vim patch 9.1.0721: tests: test_mksession does not consider XDG_CONFIG_HOME 2024-09-08 20:00:38 +02:00
setup_gui.vim
shared.vim patch 9.1.0841: tests: still preferring python2 over python3 2024-11-04 20:26:47 +01:00
silent.wav
summarize.vim
term_util.vim patch 9.1.0794: tests: tests may fail on Windows environment 2024-10-20 11:06:00 +02:00
test10.in
test10.ok
test20.in
test20.ok
test21.in
test21.ok
test22.in
test22.ok
test23.in
test23.ok
test24.in
test24.ok
test25.in
test25.ok
test26.in
test26.ok
test27.in
test27.ok
test28.in patch 9.1.0546: vim-tiny fails on CTRL-X/CTRL-A 2024-07-08 21:12:55 +02:00
test28.ok patch 9.1.0546: vim-tiny fails on CTRL-X/CTRL-A 2024-07-08 21:12:55 +02:00
test77a.com
test77a.in
test77a.ok
test_alot.vim
test_alot_latin.vim
test_alot_utf8.vim
test_arabic.vim
test_arglist.vim patch 9.1.0678: [security]: use-after-free in alist_add() 2024-08-15 22:15:28 +02:00
test_assert.vim patch 9.1.0666: assert_equal() doesn't show multibyte string correctly 2024-08-09 19:52:10 +02:00
test_autochdir.vim
test_autocmd.vim patch 9.1.0794: tests: tests may fail on Windows environment 2024-10-20 11:06:00 +02:00
test_autoload.vim patch 9.1.0419: eval.c not sufficiently tested 2024-05-19 09:06:50 +02:00
test_backspace_opt.vim
test_backup.vim
test_balloon.vim patch 9.1.0491: Cmdline pum doesn't work properly with 'rightleft' 2024-06-15 15:37:11 +02:00
test_balloon_gui.vim
test_behave.vim
test_bench_regexp.vim
test_blob.vim patch 9.1.0415: Some functions are not tested 2024-05-17 18:20:43 +02:00
test_blockedit.vim
test_breakindent.vim patch 9.1.0720: Wrong breakindentopt=list:-1 with multibyte or TABs 2024-09-07 11:23:54 +02:00
test_buffer.vim patch 9.1.0557: moving in the buffer list doesn't work as documented 2024-07-10 20:20:48 +02:00
test_bufline.vim
test_bufwintabinfo.vim
test_cd.vim patch 9.1.0568: Cannot expand paths from 'cdpath' setting 2024-07-11 22:45:42 +02:00
test_cdo.vim
test_changedtick.vim
test_changelist.vim
test_channel.py
test_channel.vim patch 9.1.0820: tests: Mac OS tests are too flaky 2024-10-28 21:56:50 +01:00
test_channel_6.py
test_channel_lsp.py
test_channel_pipe.py
test_channel_unix.py
test_channel_write.py
test_charsearch.vim
test_charsearch_utf8.vim
test_checkpath.vim
test_cindent.vim
test_cjk_linebreak.vim
test_clientserver.vim
test_close_count.vim
test_cmd_lists.vim
test_cmdline.vim patch 9.1.0883: message history cleanup is missing some tests 2024-11-24 13:48:05 +01:00
test_cmdmods.vim patch 9.1.0748: :keep* commmands are sometimes misidentified as :k 2024-09-29 17:17:41 +02:00
test_cmdwin.vim
test_codestyle.vim patch 9.1.0606: tests: generated files may cause failure in test_codestyle 2024-07-20 11:55:13 +02:00
test_command_count.vim
test_comments.vim
test_comparators.vim
test_compiler.vim patch 9.1.0326: filetype: some requirements files are not recognized 2024-04-14 20:43:27 +02:00
test_conceal.vim
test_const.vim
test_cpoptions.vim patch 9.1.0589: vi: d{motion} and cw work differently than expected 2024-07-15 20:51:11 +02:00
test_crash.vim patch 9.1.0703: crash with 2byte encoding and glob2regpat() 2024-08-29 22:15:03 +02:00
test_crypt.vim
test_cscope.vim
test_cursor_func.vim patch 9.1.0759: screenpos() may return invalid position 2024-10-05 17:30:22 +02:00
test_cursorline.vim patch 9.1.0730: Crash with cursor-screenline and narrow window 2024-09-14 10:40:29 +02:00
test_curswant.vim patch 9.1.0869: Problem: curswant not set on gm in folded line 2024-11-17 16:18:00 +01:00
test_debugger.vim
test_delete.vim
test_diffmode.vim patch 9.1.0849: there are a few typos in the source 2024-11-10 20:26:12 +01:00
test_digraph.vim patch 9.1.0332: tests: some assert_equal() calls have wrong order of args 2024-04-15 19:01:04 +02:00
test_display.vim
test_edit.vim patch 9.1.0415: Some functions are not tested 2024-05-17 18:20:43 +02:00
test_environ.vim
test_erasebackword.vim
test_escaped_glob.vim
test_eval_stuff.vim patch 9.1.0665: Locked variable can be changed in a :for loop 2024-08-08 21:05:57 +02:00
test_ex_equal.vim
test_ex_mode.vim patch 9.1.0713: Newline causes E749 in Ex mode 2024-09-03 22:58:30 +02:00
test_ex_undo.vim
test_ex_z.vim
test_excmd.vim patch 9.1.0579: Ex command is still executed after giving E1247 2024-07-13 19:04:10 +02:00
test_exec_while_if.vim
test_execute_func.vim
test_exists.vim patch 9.1.0748: :keep* commmands are sometimes misidentified as :k 2024-09-29 17:17:41 +02:00
test_exists_autocmd.vim
test_exit.vim
test_expand.vim
test_expand_dllpath.vim
test_expand_func.vim
test_expr.vim runtime(misc): Use consistent "Vim script" spelling 2024-10-13 19:16:42 +02:00
test_expr_utf8.vim
test_file_perm.vim
test_file_size.vim
test_filechanged.vim patch 9.1.0268: Two tests in test_filechanged.vim are slow 2024-04-05 20:05:11 +02:00
test_filecopy.vim patch 9.1.0465: missing filecopy() function 2024-06-03 23:01:40 +02:00
test_fileformat.vim
test_filetype.vim patch 9.1.0880: filetype: C3 files are not recognized 2024-11-19 23:05:21 +01:00
test_filter_cmd.vim
test_filter_map.vim
test_find_complete.vim
test_findfile.vim patch 9.1.0835: :setglobal doesn't work properly for 'ffu' and 'tsrfu' 2024-11-03 09:23:33 +01:00
test_fixeol.vim
test_flatten.vim
test_float_func.vim
test_fnameescape.vim
test_fnamemodify.vim patch 9.1.0569: fnamemodify() treats ".." and "../" differently 2024-07-12 07:29:14 +02:00
test_fold.vim patch 9.1.0672: marker folds may get corrupted on undo 2024-08-11 20:12:41 +02:00
test_format.vim
test_function_lists.vim
test_functions.vim patch 9.1.0871: getcellpixels() can be further improved 2024-11-18 21:12:21 +01:00
test_ga.vim
test_getcwd.vim
test_gettext.vim patch 9.1.0560: bindtextdomain() does not indicate an error 2024-07-11 21:36:21 +02:00
test_gettext_cp1251.vim patch 9.1.0560: bindtextdomain() does not indicate an error 2024-07-11 21:36:21 +02:00
test_gettext_make.vim patch 9.1.0712: tests: missing dependency of Test_gettext_makefile 2024-09-03 22:50:38 +02:00
test_gettext_makefile_in1.vim patch 9.1.0559: translation of vim scripts can be improved 2024-07-11 21:14:15 +02:00
test_gettext_makefile_in2.vim patch 9.1.0559: translation of vim scripts can be improved 2024-07-11 21:14:15 +02:00
test_gettext_makefile_in3.vim patch 9.1.0559: translation of vim scripts can be improved 2024-07-11 21:14:15 +02:00
test_gettext_makefile_in4.vim patch 9.1.0559: translation of vim scripts can be improved 2024-07-11 21:14:15 +02:00
test_gettext_utf8.vim patch 9.1.0560: bindtextdomain() does not indicate an error 2024-07-11 21:36:21 +02:00
test_getvar.vim patch 9.1.0799: tests: gettwinvar()/gettabwinvar() tests are not comprehensive 2024-10-22 21:23:31 +02:00
test_gf.vim
test_glob2regpat.vim
test_global.vim patch 9.1.0438: Wrong Ex command executed when :g uses '?' as delimiter 2024-05-24 07:37:36 +02:00
test_glvs.vim patch 9.1.0859: several problems with the GLVS plugin 2024-11-12 20:23:41 +01:00
test_gn.vim
test_goto.vim patch 9.1.0667: Some other options reset curswant unnecessarily when set 2024-08-10 09:35:20 +02:00
test_gui.vim patch 9.1.0587: tests: Test_gui_lowlevel_keyevent is still flaky 2024-07-15 19:52:25 +02:00
test_gui_init.vim
test_hardcopy.vim
test_help.vim
test_help_tagjump.vim
test_hide.vim
test_highlight.vim patch 9.1.0277: Cannot highlight the Command-line 2024-04-08 22:16:33 +02:00
test_history.vim patch 9.1.0439: Cannot filter the history 2024-05-24 07:39:34 +02:00
test_hlsearch.vim
test_iminsert.vim
test_increment.vim patch 9.1.0537: signed number detection for CTRL-X/A can be improved 2024-07-06 17:55:26 +02:00
test_increment_dbcs.vim
test_indent.vim
test_input.vim
test_ins_complete.vim patch 9.1.0835: :setglobal doesn't work properly for 'ffu' and 'tsrfu' 2024-11-03 09:23:33 +01:00
test_ins_complete_no_halt.vim
test_interrupt.vim
test_job_fails.vim
test_join.vim
test_json.vim
test_jumplist.vim patch 9.1.0556: :bwipe doesn't remove file from jumplist of other tabpages 2024-07-10 19:36:36 +02:00
test_lambda.vim
test_langmap.vim
test_largefile.vim
test_let.vim patch 9.1.0335: String interpolation fails for List type 2024-04-15 19:19:52 +02:00
test_lineending.vim
test_lispindent.vim
test_listchars.vim
test_listdict.vim patch 9.1.0747: various typos in repo found 2024-09-29 10:37:47 +02:00
test_listener.vim
test_listlbr.vim
test_listlbr_utf8.vim patch 9.1.0601: Wrong cursor position with 'breakindent' when wide char doesn't fit 2024-07-18 21:13:31 +02:00
test_lua.vim patch 9.1.0848: if_lua: v:false/v:true are not evaluated to boolean 2024-11-09 18:31:08 +01:00
test_makeencoding.py
test_makeencoding.vim
test_man.vim
test_map_functions.vim patch 9.1.0814: mapset() may remove unrelated mapping 2024-10-24 21:43:43 +02:00
test_mapping.vim patch 9.1.0767: A condition is always true in ex_getln.c 2024-10-08 21:04:19 +02:00
test_marks.vim
test_match.vim patch 9.1.0340: Problem: Error with matchaddpos() and empty list 2024-04-16 22:23:17 +02:00
test_matchadd_conceal.vim
test_matchadd_conceal_utf8.vim
test_matchfuzzy.vim
test_matchparen.vim patch 9.1.0694: matchparen is slow on a long line 2024-08-24 16:32:24 +02:00
test_memory_usage.vim
test_menu.vim patch 9.1.0525: Right release selects immediately when pum is truncated. 2024-07-04 17:26:37 +02:00
test_messages.vim
test_method.vim patch 9.1.0415: Some functions are not tested 2024-05-17 18:20:43 +02:00
test_mksession.vim patch 9.1.0721: tests: test_mksession does not consider XDG_CONFIG_HOME 2024-09-08 20:00:38 +02:00
test_mksession_utf8.vim
test_modeless.vim
test_modeline.vim patch 9.1.0831: 'findexpr' can't be used as lambad or Funcref 2024-11-02 18:43:42 +01:00
test_move.vim
test_mswin_event.vim
test_mzscheme.vim
test_nested_function.vim
test_netbeans.py
test_netbeans.vim
test_normal.vim patch 9.1.0860: tests: mouse_shape tests use hard code sleep value 2024-11-12 20:26:48 +01:00
test_number.vim
test_options.vim patch 9.1.0864: message history is fixed to 200 2024-11-14 22:34:24 +01:00
test_options_all.vim patch 9.1.0797: testing of options can be further improved 2024-10-21 22:20:51 +02:00
test_packadd.vim
test_partial.vim patch 9.1.0547: No way to get the arity of a Vim function 2024-07-09 18:31:12 +02:00
test_paste.vim patch 9.1.0573: ex: no implicit print for single addresses 2024-07-12 20:18:54 +02:00
test_perl.vim
test_plus_arg_edit.vim
test_popup.vim patch 9.1.0830: using wrong highlight group for spaces for popupmenu 2024-11-02 16:45:01 +01:00
test_popupwin.vim patch 9.1.0710: popup window may hide part of Command line 2024-09-03 18:20:13 +02:00
test_popupwin_textprop.vim
test_preview.vim
test_profile.vim
test_prompt_buffer.vim
test_put.vim patch 9.1.0577: Unnecessary checks for v:sizeoflong in test_put.vim 2024-07-13 18:59:47 +02:00
test_python2.vim patch 9.1.0844: if_python: no way to pass local vars to python 2024-11-06 21:53:07 +01:00
test_python3.vim patch 9.1.0848: if_lua: v:false/v:true are not evaluated to boolean 2024-11-09 18:31:08 +01:00
test_pyx2.vim patch 9.1.0844: if_python: no way to pass local vars to python 2024-11-06 21:53:07 +01:00
test_pyx3.vim patch 9.1.0844: if_python: no way to pass local vars to python 2024-11-06 21:53:07 +01:00
test_quickfix.vim patch 9.1.0786: tests: quickfix update test does not test location list 2024-10-15 20:26:45 +02:00
test_quotestar.vim
test_random.vim
test_recover.vim
test_regex_char_classes.vim
test_regexp_latin.vim
test_regexp_utf8.vim patch 9.1.0645: regex: wrong match when searching multi-byte char case-insensitive 2024-07-30 20:39:18 +02:00
test_registers.vim patch 9.1.0872: No test for W23 message 2024-11-18 21:20:54 +01:00
test_reltime.vim
test_remote.vim patch 9.1.0379: There are a few typos 2024-04-28 16:20:55 +02:00
test_rename.vim
test_restricted.vim
test_retab.vim
test_ruby.vim
test_scriptnames.vim
test_scroll_opt.vim patch 9.1.0753: Wrong display when typing in diff mode with 'smoothscroll' 2024-10-01 19:35:47 +02:00
test_scrollbind.vim
test_search.vim patch 9.1.0692: Wrong patlen value in ex_substitute() 2024-08-24 11:33:39 +02:00
test_search_stat.vim
test_searchpos.vim
test_selectmode.vim patch 9.1.0580: :lmap mapping for keypad key not applied when typed in Select mode 2024-07-13 19:06:44 +02:00
test_set.vim
test_sha256.vim
test_shell.vim patch 9.1.0451: No test for escaping '<' with shellescape() 2024-05-30 19:27:25 +02:00
test_shift.vim
test_short_sleep.py
test_shortpathname.vim patch 9.1.0474: CI: Test_ColonEight() fails on github runners 2024-06-10 21:06:55 +02:00
test_signals.vim
test_signs.vim patch 9.1.0538: not possible to assign priority when defining a sign 2024-07-06 18:04:09 +02:00
test_sleep.vim
test_smartindent.vim
test_sort.vim
test_sound.vim patch 9.1.0271: CI sound test aborts with undefined variable 2024-04-05 20:16:46 +02:00
test_source.vim
test_source_utf8.vim
test_spell.vim patch 9.1.0512: Mode message for spell completion doesn't match allowed keys 2024-06-21 07:55:07 +02:00
test_spell_utf8.vim
test_spellfile.vim patch 9.1.0783: 'spell' option setting has problems 2024-10-14 20:21:48 +02:00
test_spellrare.vim patch 9.1.0419: eval.c not sufficiently tested 2024-05-19 09:06:50 +02:00
test_startup.vim
test_startup_utf8.vim
test_stat.vim
test_statusline.vim
test_substitute.vim patch 9.1.0677: :keepp does not retain the substitute pattern 2024-08-15 22:09:28 +02:00
test_suspend.vim
test_swap.vim patch 9.1.0794: tests: tests may fail on Windows environment 2024-10-20 11:06:00 +02:00
test_syn_attr.vim
test_syntax.vim
test_system.vim
test_tab.vim
test_tabline.vim
test_tabpage.vim patch 9.1.0572: cannot specify tab page closing behaviour 2024-07-12 19:36:53 +02:00
test_tagcase.vim
test_tagfunc.vim
test_tagjump.vim patch 9.1.0556: :bwipe doesn't remove file from jumplist of other tabpages 2024-07-10 19:36:36 +02:00
test_taglist.vim patch 9.1.0581: Various lines are indented inconsistently 2024-07-14 10:20:20 +02:00
test_tcl.vim
test_termcodes.vim patch 9.1.0788: <CSI>27;<mod>u is not decoded to literal Escape in kitty/foot 2024-10-16 17:28:38 +02:00
test_termdebug.vim patch 9.1.0878: termdebug: cannot enable DEBUG mode 2024-11-19 22:32:30 +01:00
test_termencoding.vim
test_terminal.vim patch 9.1.0808: Terminal scrollback doesn't shrink when decreasing 'termwinscroll' 2024-10-22 23:17:45 +02:00
test_terminal2.vim patch 9.1.0794: tests: tests may fail on Windows environment 2024-10-20 11:06:00 +02:00
test_terminal3.vim patch 9.1.0787: cursor position changed when using hidden terminal 2024-10-15 20:38:57 +02:00
test_terminal_fail.vim
test_textformat.vim patch 9.1.0379: There are a few typos 2024-04-28 16:20:55 +02:00
test_textobjects.vim patch 9.1.0504: inner-tag textobject confused about ">" in attributes 2024-06-19 20:26:51 +02:00
test_textprop.vim patch 9.1.0815: "above" virtual text causes wrong 'colorcolumn' position 2024-10-27 19:24:53 +01:00
test_timers.vim
test_tohtml.vim patch 9.1.0578: no tests for :Tohtml 2024-07-13 19:02:10 +02:00
test_true_false.vim
test_trycatch.vim
test_undo.vim patch 9.1.0843: too many strlen() calls in undo.c 2024-11-06 21:39:15 +01:00
test_unlet.vim
test_user_func.vim
test_usercommands.vim patch 9.1.0685: too many strlen() calls in usercmd.c 2024-08-20 20:57:23 +02:00
test_utf8.vim patch 9.1.0863: getcellpixels() can be further improved 2024-11-14 22:13:48 +01:00
test_utf8_comparisons.vim
test_vartabs.vim patch 9.1.0456: Left shift is incorrect with vartabstop and shiftwidth=0 2024-06-01 20:51:33 +02:00
test_version.vim
test_vim9_assign.vim patch 9.1.0415: Some functions are not tested 2024-05-17 18:20:43 +02:00
test_vim9_builtin.vim patch 9.1.0646: Vim9: imported function may not be found 2024-07-31 22:18:11 +02:00
test_vim9_class.vim patch 9.1.0861: Vim9: no runtime check for object member access of any var 2024-11-12 21:03:00 +01:00
test_vim9_cmd.vim patch 9.1.0688: Vim9: dereferences NULL pointer in check_type_is_value() 2024-08-22 21:25:18 +02:00
test_vim9_disassemble.vim patch 9.1.0523: Vim9: cannot downcast an object 2024-07-04 17:03:17 +02:00
test_vim9_enum.vim patch 9.1.0376: Vim9: Trailing commands after class/enum keywords ignored 2024-04-27 11:48:26 +02:00
test_vim9_expr.vim patch 9.1.0419: eval.c not sufficiently tested 2024-05-19 09:06:50 +02:00
test_vim9_fails.vim
test_vim9_func.vim patch 9.1.0682: Vim9: Segfault with uninitialized funcref 2024-08-19 21:47:35 +02:00
test_vim9_import.vim patch 9.1.0831: 'findexpr' can't be used as lambad or Funcref 2024-11-02 18:43:42 +01:00
test_vim9_python3.vim patch 9.1.0844: if_python: no way to pass local vars to python 2024-11-06 21:53:07 +01:00
test_vim9_script.vim patch 9.1.0589: vi: d{motion} and cw work differently than expected 2024-07-15 20:51:11 +02:00
test_vim9_typealias.vim patch 9.1.0400: Vim9: confusing error message for unknown type 2024-05-09 09:15:02 +02:00
test_viminfo.vim patch 9.1.0420: :browse oldfiles prompts even with single entry 2024-05-19 09:11:09 +02:00
test_vimscript.vim patch 9.1.0529: silent! causes following try/catch to not work 2024-07-04 19:23:16 +02:00
test_virtualedit.vim patch 9.1.0388: cursor() and getregion() don't handle v:maxcol well 2024-05-02 13:06:24 +02:00
test_visual.vim patch 9.1.0477: block_editing errors out when using <enter> 2024-06-11 20:37:59 +02:00
test_winbar.vim
test_winbuf_close.vim
test_window_cmd.vim patch 9.1.0789: tests: ':resize + 5' has invalid space after '+' 2024-10-16 20:03:44 +02:00
test_window_id.vim
test_windows_home.vim patch 9.1.0794: tests: tests may fail on Windows environment 2024-10-20 11:06:00 +02:00
test_winfixbuf.vim patch 9.1.0554: :bw leaves jumplist and tagstack data around 2024-07-09 20:03:24 +02:00
test_wnext.vim
test_wordcount.vim
test_writefile.vim
test_xdg.vim patch 9.1.0718: hard to know the users personal Vim Runtime Directory 2024-09-05 17:46:19 +02:00
test_xxd.vim patch 9.1.0857: xxd: --- is incorrectly recognized as end-of-options 2024-11-11 22:19:50 +01:00
test_zip_plugin.vim patch 9.1.0686: zip-plugin has problems with special characters 2024-08-20 22:41:52 +02:00
thread_util.py
unix.vim
view_util.vim patch 9.1.0611: ambiguous mappings not correctly resolved with modifyOtherKeys 2024-07-23 20:42:02 +02:00
viewdumps.vim patch 9.1.0807: tests: having 'nolist' in modelines isn't always desired 2024-10-22 23:11:27 +02:00
vim9.vim patch 9.1.0364: tests: test_vim9_builtin is a bit slow 2024-04-22 20:58:24 +02:00
vms.vim

This directory contains tests for various Vim features.
For testing an indent script see runtime/indent/testdir/README.txt.

If it makes sense, add a new test method to an already existing file.  You may
want to separate it from other tests with comment lines.

TO ADD A NEW STYLE TEST:

1) Create a test_<subject>.vim file.
2) Add test_<subject>.res to NEW_TESTS_RES in Make_all.mak in alphabetical
   order.
3) Also add an entry "test_<subject>" to NEW_TESTS in Make_all.mak.
4) Use make test_<subject> to run a single test.

At 2), instead of running the test separately, it can be included in
"test_alot".  Do this for quick tests without side effects.  The test runs a
bit faster, because Vim doesn't have to be started, one Vim instance runs many
tests.

At 4), to run a test in GUI, add "GUI_FLAG=-g" to the make command.


What you can use (see test_assert.vim for an example):

- Call assert_equal(), assert_true(), assert_false(), etc.

- Use assert_fails() to check for expected errors.

- Use try/catch to avoid an exception aborts the test.

- Use test_alloc_fail() to have memory allocation fail.  This makes it possible
  to check memory allocation failures are handled gracefully.  You need to
  change the source code to add an ID to the allocation.  Add a new one to
  alloc_id_T, before aid_last.

- Use test_override() to make Vim behave differently, e.g.  if char_avail()
  must return FALSE for a while.  E.g. to trigger the CursorMovedI autocommand
  event. See test_cursor_func.vim for an example.

- If the bug that is being tested isn't fixed yet, you can throw an exception
  with "Skipped" so that it's clear this still needs work.  E.g.: throw
  "Skipped: Bug with <c-e> and popupmenu not fixed yet"

- The following environment variables are recognized and can be set to
  influence the behavior of the test suite (see runtest.vim for details)

  - $TEST_MAY_FAIL=Test_channel_one    - ignore those failing tests
  - $TEST_FILTER=Test_channel    - only run test that match this pattern
  - $TEST_SKIP_PAT=Test_channel  - skip tests that match this pattern
  - $TEST_NO_RETRY=yes           - do not try to re-run failing tests
  You can also set them in Vim:
    :let $TEST_MAY_FAIL = 'Test_channel_one'
    :let $TEST_FILTER = '_set_mode'
    :let $TEST_SKIP_PAT = 'Test_loop_forever'
    :let $TEST_NO_RETRY = 'yes'
  Use an empty string to revert, e.g.:
    :let $TEST_FILTER = ''

- See the start of runtest.vim for more help.


TO ADD A SCREEN DUMP TEST:

Mostly the same as writing a new style test.  Additionally, see help on
"terminal-dumptest".  Put the reference dump in "dumps/Test_func_name.dump".


OLD STYLE TESTS:

There are a few tests that are used when Vim was built without the +eval
feature.  These cannot use the "assert" functions, therefore they consist of a
.in file that contains Normal mode commands between STARTTEST and ENDTEST.
They modify the file and the result gets written in the test.out file.  This
is then compared with the .ok file.  If they are equal the test passed.  If
they differ the test failed.


RUNNING THE TESTS:

To run a single test from the src directory:

    $ make test_<name>

The below commands should be run from the src/testdir directory.

To run a single test:

    $ make test_<name>.res

The file 'messages' contains the messages generated by the test script.  If a
test fails, then the test.log file contains the error messages.  If all the
tests are successful, then this file will be an empty file.

- To run a single test function from a test script:

    $ ../vim -u NONE -S runtest.vim <test_file>.vim <function_name>

- To execute only specific test functions, add a second argument:

    $ ../vim -u NONE -S runtest.vim test_channel.vim open_delay

- To run all the tests:

    $ make

- To run the test on MS-Windows using the MSVC nmake:

    > nmake -f Make_mvc.mak

- To run the tests with GUI Vim:

    $ make GUI_FLAG=-g

    or

    $ make VIMPROG=../gvim

- To cleanup the temporary files after running the tests:

    $ make clean


VIEWING GENERATED SCREENDUMPS (local):

You may also wish to look at the whole batch of failed screendumps after
running "make".  Source the "viewdumps.vim" script for this task:

    $ ../vim -u NONE -S viewdumps.vim \
				[dumps/Test_xxd_*.dump ...]

By default, all screendumps found in the "failed" directory will be added to
the argument list and then the first one will be loaded.  Loaded screendumps
that bear filenames of screendumps found in the "dumps" directory will be
rendering the contents of any such pair of files and the difference between
them (:help term_dumpdiff()); otherwise, they will be rendering own contents
(:help term_dumpload()).  Remember to execute :edit when occasionally you see
raw file contents instead of rendered.

At any time, you can add, list, and abandon other screendumps:

    :$argedit dumps/Test_spell_*.dump
    :args
    :qall

The listing of argument commands can be found under :help buffer-list.


VIEWING GENERATED SCREENDUMPS (from a CI-uploaded artifact):

After you have downloaded an artifact archive containing failed screendumps
and extracted its files in a temporary directory, you need to set up a "dumps"
directory by creating a symlink:

    $ cd /path/to/fork
    $ ln -s $(pwd)/src/testdir/dumps /tmp/src/testdir/dumps

You can now examine the extracted screendumps:

    $ ./src/vim -u NONE -S src/testdir/viewdumps.vim \
				/tmp/src/testdir/failed/*.dump


VIEWING GENERATED SCREENDUMPS (submitted for a pull request):

First, you need to check out the topic branch with the proposed changes and
write down a difference list between the HEAD commit (index) and its parent
commit with respect to the changed "dumps" filenames:

    $ cd /path/to/fork
    $ git switch prs/1234
    $ git diff-index --relative=src/testdir/dumps/ \
				--name-only prs/1234~1 > /tmp/filelist

Then, you need to check out the master branch, change the current working
directory to reconcile relative filepaths written in the filenames list,
possibly create an empty "failed" directory, copy in this directory the old
"dumps" files, whose names are on the same list, and follow it by checking out
the topic branch:

    $ git switch master
    $ cd src/testdir/dumps
    $ test -d ../failed || mkdir ../failed
    $ cp -t ../failed $(cat /tmp/filelist)
    $ git switch prs/1234

Make note of any missing new screendumps.  Please remember about the
introduced INVERTED relation between "dumps" and "failed", i.e. the files to
be committed are in "dumps" already and their old versions are in "failed".
Therefore, you need to copy the missing new screendumps from "dumps" to
"failed":

    $ cp -t ../failed foo_10.dump foo_11.dump foo_12.dump

After you have changed the current working directory to its parent directory,
you can now examine the screendumps from the "failed" directory (note that new
screendumps will be shown with no difference between their versions):

    $ cd ..
    $ ../vim -u NONE -S viewdumps.vim