neovim/test/old/testdir
zeertzjq e57598fbef vim-patch:9.1.0645: regex: wrong match when searching multi-byte char case-insensitive
Problem:  regex: wrong match when searching multi-byte char
          case-insensitive (diffsetter)
Solution: Apply proper case-folding for characters and search-string

This patch does the following 4 things:

1) When the regexp engine compares two utf-8 codepoints case
   insensitive it may match an adjacent character, because it assumes
   it can step over as many bytes as the pattern contains.

   This however is not necessarily true because of case-folding, a
   multi-byte UTF-8 character can be considered equal to some
   single-byte value.

   Let's consider the pattern 'ſ' and the string 's'. When comparing and
   ignoring case, the single character 's' matches, and since it matches
   Vim will try to step over the match (by the amount of bytes of the
   pattern), assuming that since it matches, the length of both strings is
   the same.

   However in that case, it should only step over the single byte value
   's' by 1 byte and try to start matching after it again. So for the
   backtracking engine we need to ensure:
   * we try to match the correct length for the pattern and the text
   * in case of a match, we step over it correctly

   There is one tricky thing for the backtracing engine. We also need to
   calculate correctly the number of bytes to compare the 2 different
   utf-8 strings s1 and s2. So we will count the number of characters in
   s1 that the byte len specified. Then we count the number of bytes to
   step over the same number of characters in string s2 and then we can
   correctly compare the 2 utf-8 strings.

2) A similar thing can happen for the NFA engine, when skipping to the
   next character to test for a match. We are skipping over the regstart
   pointer, however we do not consider the case that because of
   case-folding we may need to adjust the number of bytes to skip over.
   So this needs to be adjusted in find_match_text() as well.

3) A related issue turned out, when prog->match_text is actually empty.
   In that case we should try to find the next match and skip this
   condition.

4) When comparing characters using collections, we must also apply case
   folding to each character in the collection and not just to the
   current character from the search string.  This doesn't apply to the
   NFA engine, because internally it converts collections to branches
   [abc] -> a\|b\|c

fixes: vim/vim#14294
closes: vim/vim#14756

22e8e12d9f

N/A patches:
vim-patch:9.0.1771: regex: combining chars in collections not handled
vim-patch:9.0.1777: patch 9.0.1771 causes problems

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-07-31 08:03:31 +08:00
..
crash vim-patch:9.0.2143: [security]: buffer-overflow in ex_substitute 2023-12-02 10:41:31 +08:00
pyxfile test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
samples vim-patch:9.0.2134: ml_get error when scrolling (#26264) 2023-11-29 13:24:24 +08:00
sautest/autoload vim-patch:8.2.1398: autoload script sourced twice if sourced directly (#22622) 2023-03-11 21:29:25 +08:00
check.vim vim-patch:9.0.0607: verbose echo message test fails on Mac OS 2023-09-29 06:07:27 +08:00
dotest.in test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
load.vim test: improve test conventions 2024-04-23 18:17:04 +02:00
Make_all.mak test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
Makefile test(old): correct path to .valgrind.supp (#27306) 2024-02-02 22:24:37 +08:00
mouse.vim vim-patch:partial:8.2.1235: Not all mouse codes covered by tests 2023-04-28 17:55:44 +08:00
README.txt test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
runnvim.sh test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
runnvim.vim test(old): change back to using termopen() on Windows (#27772) 2024-03-08 12:21:11 +08:00
runtest.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
screendump.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
script_util.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
setup.vim vim-patch:9.1.0573: ex: no implicit print for single addresses 2024-07-14 13:39:40 +08:00
shared.vim test(old): remove workaround for TSAN CI (#24834) 2023-08-22 20:03:03 +08:00
suite.sh test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
summarize.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
term_util.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test1.in test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test1.ok test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_alot_latin.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_alot_utf8.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_alot.vim vim-patch:9.0.0892: may redraw when not needed 2023-05-02 13:11:47 +02:00
test_arabic.vim vim-patch:9.0.2092: tests: failure in test_arabic 2023-11-05 21:56:56 +01:00
test_arglist.vim vim-patch:9.0.0380: deleting files in tests is a hassle 2023-08-22 18:56:43 +08:00
test_assert.vim vim-patch:7.4.1565 (#29734) 2024-07-16 03:44:17 +00:00
test_autochdir.vim vim-patch:9.0.0411: only created files can be cleaned up with one call 2023-04-16 15:04:41 +08:00
test_autocmd.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_autoload.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_backspace_opt.vim feat(options)!: remove compatible behaviours for vim 5.0 and earlier 2023-07-17 14:27:21 +01:00
test_backup.vim vim-patch:9.0.0391: using separate delete() call instead of writefile() 'D' flag 2023-08-22 18:56:43 +08:00
test_blob.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_blockedit.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_breakindent.vim vim-patch:9.1.0601: Wrong cursor position with 'breakindent' when wide char doesn't fit (#29793) 2024-07-19 03:54:42 +00:00
test_buffer.vim vim-patch:9.1.0557: moving in the buffer list doesn't work as documented (#29653) 2024-07-11 08:02:59 +08:00
test_bufline.vim vim-patch:9.0.0837: append() reports failure when not appending anything 2023-08-22 18:56:43 +08:00
test_bufwintabinfo.vim vim-patch:8.1.2373: cannot build with +popupwin but without +quickfix 2023-11-13 13:50:43 +08:00
test_cd.vim vim-patch:9.1.0568: Cannot expand paths from 'cdpath' setting 2024-07-12 07:39:36 +08:00
test_cdo.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_changedtick.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_changelist.vim vim-patch:9.0.0336: tests are flaky because of using a common file name 2023-11-13 09:26:59 +08:00
test_charsearch_utf8.vim vim-patch:9.0.1555: setcharsearch() does not clear last searched char properly (#23631) 2023-05-15 08:04:23 +08:00
test_charsearch.vim vim-patch:9.0.1555: setcharsearch() does not clear last searched char properly (#23631) 2023-05-15 08:04:23 +08:00
test_checkpath.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_cindent.vim vim-patch:9.0.1426: indent wrong after "export namespace" in C++ (#22777) 2023-03-25 09:27:42 +08:00
test_cjk_linebreak.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_clientserver.vim vim-patch:9.0.0336: tests are flaky because of using a common file name 2023-11-13 09:26:59 +08:00
test_close_count.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_cmdline.vim vim-patch:9.1.0568: Cannot expand paths from 'cdpath' setting 2024-07-12 07:39:36 +08:00
test_cmdwin.vim vim-patch:9.1.0049: Make "[Command Line]" a special buffer name 2024-01-28 12:29:42 +00:00
test_codestyle.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_command_count.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_comments.vim vim-patch:9.1.0138: too many STRLEN calls when getting a memline (#27799) 2024-03-10 17:08:00 +08:00
test_comparators.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_compiler.vim vim-patch:9.1.0326: filetype: some requirements files are not recognized (#28360) 2024-04-16 09:33:33 +08:00
test_conceal.vim vim-patch:9.1.0232: Conceal test fails when rightleft feature is disabled (#28134) 2024-04-01 06:12:47 +08:00
test_const.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_cpoptions.vim vim-patch:9.1.0585: tests: test_cpoptions leaves swapfiles around 2024-07-15 06:16:31 +08:00
test_crash.vim vim-patch:9.0.2143: [security]: buffer-overflow in ex_substitute 2023-12-02 10:41:31 +08:00
test_cursor_func.vim vim-patch:9.0.2159: screenpos() may crash with neg. column (#26542) 2023-12-13 06:17:50 +08:00
test_cursorline.vim vim-patch:8.2.4611: typos in tests; one lua line not covered by test (#24835) 2023-08-22 20:02:50 +08:00
test_curswant.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_debugger.vim vim-patch:partial:8.2.3637: typos in test files (#29172) 2024-06-04 06:07:20 +08:00
test_delete.vim vim-patch:9.0.2134: ml_get error when scrolling (#26264) 2023-11-29 13:24:24 +08:00
test_diffmode.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_digraph.vim vim-patch:9.1.0332: tests: some assert_equal() calls have wrong order of args (#28363) 2024-04-16 10:00:48 +08:00
test_display.vim vim-patch:9.1.0039: too vague errors for 'listchars'/'fillchars' (#27070) 2024-01-18 07:14:12 +08:00
test_edit.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_environ.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_erasebackword.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_escaped_glob.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_eval_stuff.vim vim-patch:9.0.0423: "for" and "while" not recognized after :vim9cmd and :legacy (#24825) 2023-08-21 09:06:21 -05:00
test_ex_equal.vim feat(lua): allow :=expr as a shorter version of :lua =expr 2023-03-22 09:10:04 +01:00
test_ex_mode.vim vim-patch:9.1.0582: Printed line doesn't overwrite colon when pressing Enter in Ex mode 2024-07-14 16:33:07 +08:00
test_ex_undo.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_ex_z.vim vim-patch:8.0.0571: negative line number when using :z^ in an empty buffer (#24836) 2023-08-22 20:56:14 +08:00
test_excmd.vim vim-patch:9.1.0579: Ex command is still executed after giving E1247 2024-07-14 06:12:42 +08:00
test_exec_while_if.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_execute_func.vim vim-patch:9.1.0169: current window number returned by tabpagewinnr may be outdated 2024-03-12 21:05:54 +00:00
test_exists_autocmd.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_exists.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_exit.vim vim-patch:9.0.1538: :wqall does not trigger ExitPre (#23574) 2023-05-11 08:09:13 +08:00
test_expand_func.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_expand.vim vim-patch:9.1.0161: expand() removes slash after env variable that ends with colon (#27791) 2024-03-10 06:47:09 +08:00
test_expr_utf8.vim vim-patch:8.2.2607: strcharpart() cannot include composing characters 2023-05-04 17:49:56 +08:00
test_expr.vim vim-patch:9.1.0335: String interpolation fails for List type (#28364) 2024-04-16 10:18:24 +08:00
test_file_perm.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_file_size.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_filechanged.vim vim-patch:9.1.0268: Two tests in test_filechanged.vim are slow 2024-04-06 05:58:55 +08:00
test_fileformat.vim vim-patch:9.0.0904: various comment and indent flaws (#23498) 2023-05-06 09:34:29 +08:00
test_filetype.vim vim-patch:9.1.0636: filetype: ziggy files are not recognized 2024-07-29 09:12:14 +02:00
test_filter_cmd.vim vim-patch:8.1.2373: cannot build with +popupwin but without +quickfix 2023-11-13 13:50:43 +08:00
test_filter_map.vim vim-patch:partial:9.1.0027: Vim is missing a foreach() func (#27037) 2024-01-16 11:30:35 +08:00
test_find_complete.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_findfile.vim vim-patch:9.1.0569: fnamemodify() treats ".." and "../" differently (#29673) 2024-07-12 14:30:49 +08:00
test_fixeol.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_flatten.vim vim-patch:partial:8.2.3637: typos in test files (#29172) 2024-06-04 06:07:20 +08:00
test_float_func.vim vim-patch:8.2.2949: tests failing because no error for float to string conversion 2023-06-12 13:27:16 +08:00
test_fnameescape.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_fnamemodify.vim vim-patch:9.1.0569: fnamemodify() treats ".." and "../" differently (#29673) 2024-07-12 14:30:49 +08:00
test_fold.vim vim-patch:9.1.0617: Cursor moves beyond first line of folded end of buffer (#29859) 2024-07-26 06:32:54 +08:00
test_format.vim vim-patch:9.1.0181: no overflow check for string formatting (#27863) 2024-03-15 08:05:59 +08:00
test_functions.vim vim-patch:9.1.0499: MS-Windows: doesn't handle symlinks properly (#29400) 2024-06-19 06:32:02 +08:00
test_ga.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_getcwd.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_getvar.vim vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638) 2024-07-10 08:07:16 +08:00
test_gf.vim vim-patch:9.0.1546: some commands for opening a file don't use 'switchbuf' (#23600) 2023-05-13 08:40:06 +08:00
test_glob2regpat.vim vim-patch:8.2.2949: tests failing because no error for float to string conversion 2023-06-12 13:27:16 +08:00
test_global.vim vim-patch:9.1.0438: Wrong Ex command executed when :g uses '?' as delimiter (#28956) 2024-05-24 15:04:33 +08:00
test_gn.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_goto.vim vim-patch:9.1.0594: Unnecessary redraw when setting 'winfixbuf' (#29775) 2024-07-18 06:45:26 +08:00
test_gui.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_help_tagjump.vim vim-patch:9.0.0336: tests are flaky because of using a common file name 2023-11-13 09:26:59 +08:00
test_help.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_hide.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_highlight.vim vim-patch:9.1.0277: Cannot highlight the Command-line (#28244) 2024-04-09 07:20:49 +08:00
test_history.vim vim-patch:9.1.0439: Cannot filter the history (#28958) 2024-05-24 15:45:07 +08:00
test_hlsearch.vim vim-patch:9.0.1588: Incsearch not triggered when pasting clipboard register (#23817) 2023-05-30 07:18:12 +08:00
test_increment_dbcs.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_increment.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_indent.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_input.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_ins_complete_no_halt.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_ins_complete.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_interrupt.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_join.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_jumplist.vim vim-patch:9.1.0556: :bwipe doesn't remove file from jumplist of other tabpages (#29651) 2024-07-11 06:26:22 +08:00
test_lambda.vim vim-patch:8.2.0183: tests fail when the float feature is disabled (#29738) 2024-07-16 06:25:35 +00:00
test_langmap.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_largefile.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_let.vim vim-patch:8.1.1588: in :let-heredoc line continuation is recognized (#29767) 2024-07-17 12:06:59 +00:00
test_lineending.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_lispindent.vim refactor(cpoptions): remove 'p' 2023-12-25 14:13:52 +01:00
test_listchars.vim vim-patch:9.1.0039: too vague errors for 'listchars'/'fillchars' (#27070) 2024-01-18 07:14:12 +08:00
test_listdict.vim vim-patch:9.0.0331: cannot use items() on a string 2024-07-30 12:18:44 +08:00
test_listlbr_utf8.vim vim-patch:9.1.0601: Wrong cursor position with 'breakindent' when wide char doesn't fit (#29793) 2024-07-19 03:54:42 +00:00
test_listlbr.vim vim-patch:9.1.0054: 'linebreak' may still apply to leading whitespace 2024-01-26 07:06:43 +08:00
test_makeencoding.py test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_makeencoding.vim vim-patch:8.1.2373: cannot build with +popupwin but without +quickfix 2023-11-13 13:50:43 +08:00
test_map_functions.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_mapping.vim vim-patch:9.1.0644: Unnecessary STRLEN() when applying mapping (#29921) 2024-07-31 06:21:55 +08:00
test_marks.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_match.vim vim-patch:9.1.0340: Problem: Error with matchaddpos() and empty list (#28381) 2024-04-17 06:49:23 +08:00
test_matchadd_conceal_utf8.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_matchadd_conceal.vim vim-patch:8.2.0533: tests using term_wait() can still be flaky 2023-08-21 15:31:21 +08:00
test_matchfuzzy.vim vim-patch:9.0.1499: using uninitialized memory with fuzzy matching (#23399) 2023-04-30 08:27:38 +08:00
test_matchparen.vim vim-patch:9.1.0167: Changing buffer in another window causes it to show matchparen (#27820) 2024-03-12 07:19:47 +08:00
test_menu.vim vim-patch:9.1.0525: Right release selects immediately when pum is truncated. (#29568) 2024-07-05 07:46:01 +08:00
test_messages.vim vim-patch:9.1.0146: v:echospace wrong with invalid value of 'showcmdloc' (#27697) 2024-03-02 06:48:11 +08:00
test_method.vim vim-patch:9.0.0333: method test fails 2024-07-30 12:18:44 +08:00
test_mksession_utf8.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_mksession.vim vim-patch:9.1.0220: Few typos in source and test files (#28076) 2024-03-28 19:03:27 +08:00
test_modeline.vim vim-patch:9.0.2095: statusline may look different than expected (#25941) 2023-11-09 06:34:34 +08:00
test_move.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_nested_function.vim vim-patch:8.2.3786: test fails because of using Vim9 syntax in legacy function 2023-04-16 10:18:39 +08:00
test_normal.vim vim-patch:9.1.0526: Unwanted cursor movement with pagescroll at start of buffer (#29569) 2024-07-05 07:51:34 +08:00
test_number.vim vim-patch:9.1.0083: Redrawing can be improved when deleting lines with 'number' 2024-02-08 19:20:07 +08:00
test_options.vim vim-patch:8.1.1106: no test for 'writedelay' (#29736) 2024-07-16 05:39:20 +00:00
test_packadd.vim vim-patch:9.0.1730: passing multiple patterns to runtime not working (#24771) 2023-08-18 08:24:49 +08:00
test_partial.vim vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638) 2024-07-10 08:07:16 +08:00
test_paste.vim feat(options)!: deprecate paste, remove pastetoggle (#22647) 2023-03-13 10:29:11 +08:00
test_perl.vim test: skip flaky tests 2024-03-29 14:27:13 +01:00
test_plus_arg_edit.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_popup.vim vim-patch:9.1.0629: Rename of pum hl_group is incomplete 2024-07-27 21:56:44 +08:00
test_preview.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_profile.vim vim-patch:9.0.0415: on MS-Windows some tests are flaky 2023-08-22 18:56:43 +08:00
test_prompt_buffer.vim vim-patch:9.1.0040: issue with prompt buffer and hidden buffer (#27071) 2024-01-18 07:23:48 +08:00
test_put.vim vim-patch:9.1.0577: Unnecessary checks for v:sizeoflong in test_put.vim 2024-07-14 06:12:41 +08:00
test_python3.vim refactor: rewrite python provider in lua 2024-01-22 22:36:40 +01:00
test_pyx3.vim refactor: rewrite python provider in lua 2024-01-22 22:36:40 +01:00
test_quickfix.vim vim-patch:9.0.0003: functions are global while they could be local (#29777) 2024-07-17 23:47:20 +00:00
test_quotestar.vim vim-patch:8.2.3518: Test_xrestore sometimes fails 2023-08-21 15:35:08 +08:00
test_random.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_recover.vim vim-patch:9.1.0220: Few typos in source and test files (#28076) 2024-03-28 19:03:27 +08:00
test_regex_char_classes.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_regexp_latin.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_regexp_utf8.vim vim-patch:9.1.0645: regex: wrong match when searching multi-byte char case-insensitive 2024-07-31 08:03:31 +08:00
test_registers.vim vim-patch:9.1.0365: Crash when typing many keys with D- modifier (#28464) 2024-04-23 08:18:42 +08:00
test_reltime.vim vim-patch:8.2.3518: Test_xrestore sometimes fails 2023-08-21 15:35:08 +08:00
test_rename.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_retab.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_ruby.vim vim-patch:8.2.0183: tests fail when the float feature is disabled (#29738) 2024-07-16 06:25:35 +00:00
test_scriptnames.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_scroll_opt.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_scrollbind.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_search_stat.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_search.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_searchpos.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_selectmode.vim vim-patch:9.1.0580: :lmap mapping for keypad key not applied when typed in Select mode (#29693) 2024-07-14 06:50:36 +08:00
test_set.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_sha256.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_shell.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_shift.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_signals.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_signs.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_sleep.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_smartindent.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_sort.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_source_utf8.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_source.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_spell_utf8.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_spell.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_spellfile.vim vim-patch:9.1.0638: E1510 may happen when formatting a message for smsg() (#29907) 2024-07-29 22:26:09 +00:00
test_spellrare.vim vim-patch:9.1.0418: Cannot move to previous/next rare word (#28822) 2024-05-18 07:09:05 +08:00
test_startup_utf8.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_startup.vim vim-patch:8.1.1588: in :let-heredoc line continuation is recognized (#29767) 2024-07-17 12:06:59 +00:00
test_stat.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_statusline.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_substitute.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_suspend.vim vim-patch:8.2.0533: tests using term_wait() can still be flaky 2023-08-21 15:31:21 +08:00
test_swap.vim vim-patch:8.2.3543: swapname has double slash when 'directory' ends in it (#29862) 2024-07-26 00:09:47 +00:00
test_syn_attr.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_syntax.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_system.vim vim-patch:partial:9.0.0719: too many delete() calls in tests 2024-07-18 06:18:02 +08:00
test_tab.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_tabline.vim vim-patch:9.0.1672: tabline highlight wrong after truncated double width label (#24223) 2023-07-02 07:42:49 +08:00
test_tabpage.vim vim-patch:9.1.0572: cannot specify tab page closing behaviour (#29682) 2024-07-13 08:56:58 +08:00
test_tagcase.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_tagfunc.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_tagjump.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_taglist.vim vim-patch:9.1.0569: fnamemodify() treats ".." and "../" differently (#29673) 2024-07-12 14:30:49 +08:00
test_termcodes.vim vim-patch:8.2.2249: termcodes test is flaky when used over ssh 2023-05-06 10:03:39 +08:00
test_termdebug.vim vim-patch:9.1.0599: Termdebug: still get E1023 when specifying arguments (#29794) 2024-07-19 03:48:13 +00:00
test_textformat.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_textobjects.vim vim-patch:9.1.0504: inner-tag textobject confused about ">" in attributes (#29420) 2024-06-20 09:57:00 +08:00
test_timers.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_true_false.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_trycatch.vim vim-patch:partial:8.2.3637: typos in test files (#29172) 2024-06-04 06:07:20 +08:00
test_undo.vim vim-patch:9.1.0157: Duplicate assignment in f_getregion() (#27766) 2024-03-08 06:44:57 +08:00
test_unlet.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_user_func.vim vim-patch:9.1.0182: Can define function with invalid name inside 'formatexpr' (#27883) 2024-03-16 17:26:14 +08:00
test_usercommands.vim build(vim-patch.sh): ignore test_behave.vim (#23062) 2023-04-13 19:07:42 +08:00
test_utf8_comparisons.vim vim-patch:9.1.0105: Style: typos found (#27462) 2024-02-14 06:39:47 +08:00
test_utf8.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_vartabs.vim vim-patch:9.1.0456: Left shift is incorrect with vartabstop and shiftwidth=0 2024-06-02 06:06:34 +08:00
test_version.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_viminfo.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_vimscript.vim vim-patch:8.2.0183: tests fail when the float feature is disabled (#29738) 2024-07-16 06:25:35 +00:00
test_virtualedit.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_visual.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_winbuf_close.vim vim-patch:9.0.1257: code style is not check in test scripts 2024-07-18 06:18:03 +08:00
test_window_cmd.vim vim-patch:9.1.0175: wrong window positions with 'winfix{width,height}' (#27845) 2024-03-13 22:06:39 +00:00
test_window_id.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_windows_home.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_winfixbuf.vim vim-patch:9.1.0554: :bw leaves jumplist and tagstack data around (#29639) 2024-07-10 10:35:12 +08:00
test_wnext.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_wordcount.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
test_writefile.vim vim-patch:9.0.1967: xattr errors not translated (#25454) 2023-10-01 16:29:55 +08:00
test.sh docs: fix typos (#27868) 2024-03-28 09:32:32 +08:00
unix.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
view_util.vim test: move oldtests to test directory (#22536) 2023-03-07 11:13:04 +08:00
vim9.vim vim-patch:9.1.0364: tests: test_vim9_builtin is a bit slow (#28466) 2024-04-23 08:28:51 +08:00

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_dos.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