neovim/test/old/testdir
zeertzjq 0b2b1b0185
vim-patch:9.1.0340: Problem: Error with matchaddpos() and empty list (#28381)
Problem:  Error with matchaddpos() and empty list
          (@rickhow)
Solution: Return early for an empty list

fixes: vim/vim#14525
closes: vim/vim#14563

f7d31adcc2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-17 06:49:23 +08:00
..
crash
pyxfile
samples
sautest/autoload
check.vim
dotest.in
load.vim test: improve test conventions 2024-04-08 22:51:00 +02:00
Make_all.mak
Makefile
mouse.vim
README.txt
runnvim.sh
runnvim.vim test(old): change back to using termopen() on Windows (#27772) 2024-03-08 12:21:11 +08:00
runtest.vim
screendump.vim
script_util.vim
setup.vim feat(defaults): add :Inspect to right-click menu (#28181) 2024-04-05 18:08:54 +08:00
shared.vim
suite.sh
summarize.vim
term_util.vim
test1.in
test1.ok
test_alot_latin.vim
test_alot_utf8.vim
test_alot.vim
test_arabic.vim
test_arglist.vim
test_assert.vim
test_autochdir.vim
test_autocmd.vim vim-patch:9.1.0272: autocmd may change cwd after :tcd and :lcd (#28223) 2024-04-08 06:25:22 +08:00
test_autoload.vim
test_backspace_opt.vim
test_backup.vim
test_blob.vim
test_blockedit.vim
test_breakindent.vim
test_buffer.vim vim-patch:9.1.0265: console dialog cannot save unnamed buffers (#28185) 2024-04-05 18:32:04 +08:00
test_bufline.vim
test_bufwintabinfo.vim
test_cd.vim
test_cdo.vim
test_changedtick.vim
test_changelist.vim
test_charsearch_utf8.vim
test_charsearch.vim
test_checkpath.vim
test_cindent.vim
test_cjk_linebreak.vim
test_clientserver.vim
test_close_count.vim
test_cmdline.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_cmdwin.vim
test_codestyle.vim
test_command_count.vim
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_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_cpoptions.vim
test_crash.vim
test_cursor_func.vim
test_cursorline.vim
test_curswant.vim
test_debugger.vim
test_delete.vim
test_diffmode.vim vim-patch:9.1.0294: Text height function does not respect it's argument 2024-04-09 23:43:42 +02: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
test_edit.vim vim-patch:9.1.0329: String interpolation fails for Dict type (#28335) 2024-04-15 07:11:39 +08:00
test_environ.vim
test_erasebackword.vim
test_escaped_glob.vim
test_eval_stuff.vim
test_ex_equal.vim
test_ex_mode.vim
test_ex_undo.vim
test_ex_z.vim
test_excmd.vim vim-patch:9.1.0192: drop: don't rewind when editing the same file 2024-03-22 06:04:37 +08:00
test_exec_while_if.vim
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_exists.vim
test_exit.vim
test_expand_func.vim
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
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_file_size.vim
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
test_filetype.vim vim-patch:9.1.0326: filetype: some requirements files are not recognized (#28360) 2024-04-16 09:33:33 +08:00
test_filter_cmd.vim
test_filter_map.vim
test_find_complete.vim
test_findfile.vim
test_fixeol.vim
test_flatten.vim
test_float_func.vim
test_fnameescape.vim
test_fnamemodify.vim
test_fold.vim
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:8.1.0815: dialog for file changed outside of Vim not tested (#28184) 2024-04-05 18:04:45 +08:00
test_ga.vim
test_getcwd.vim
test_getvar.vim
test_gf.vim
test_glob2regpat.vim
test_global.vim
test_gn.vim
test_goto.vim
test_gui.vim
test_help_tagjump.vim
test_help.vim
test_hide.vim
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.0220: Few typos in source and test files (#28076) 2024-03-28 19:03:27 +08:00
test_hlsearch.vim
test_increment_dbcs.vim
test_increment.vim
test_indent.vim
test_input.vim
test_ins_complete_no_halt.vim
test_ins_complete.vim vim-patch:9.1.0254: [security]: Heap buffer overflow when calling complete_add() in 'cfu' 2024-04-03 05:55:50 +08:00
test_interrupt.vim
test_join.vim
test_jumplist.vim
test_lambda.vim
test_langmap.vim
test_largefile.vim
test_let.vim vim-patch:9.1.0335: String interpolation fails for List type (#28364) 2024-04-16 10:18:24 +08:00
test_lineending.vim
test_lispindent.vim
test_listchars.vim
test_listdict.vim
test_listlbr_utf8.vim
test_listlbr.vim
test_makeencoding.py
test_makeencoding.vim
test_map_functions.vim
test_mapping.vim
test_marks.vim
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_matchadd_conceal.vim
test_matchfuzzy.vim
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
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
test_mksession_utf8.vim
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
test_move.vim
test_nested_function.vim
test_normal.vim vim-patch:9.1.0300: Missing test for what patch v9.1.0285 fixes 2024-04-11 07:37:49 +08:00
test_number.vim
test_options.vim vim-patch:9.1.0158: 'shortmess' "F" flag doesn't work properly with 'autoread' 2024-03-08 07:04:39 +08:00
test_packadd.vim
test_partial.vim
test_paste.vim
test_perl.vim test: skip flaky tests 2024-03-29 14:27:13 +01:00
test_plus_arg_edit.vim
test_popup.vim
test_preview.vim
test_profile.vim
test_prompt_buffer.vim
test_put.vim vim-patch:9.1.0335: String interpolation fails for List type (#28364) 2024-04-16 10:18:24 +08:00
test_python3.vim
test_pyx3.vim
test_quickfix.vim
test_quotestar.vim
test_random.vim
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_regexp_latin.vim vim-patch:9.1.0220: Few typos in source and test files (#28076) 2024-03-28 19:03:27 +08:00
test_regexp_utf8.vim vim-patch:9.1.0334: No test for highlight behavior with 'ambiwidth' (#28354) 2024-04-16 06:50:23 +08:00
test_registers.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_reltime.vim
test_rename.vim
test_retab.vim
test_ruby.vim
test_scriptnames.vim
test_scroll_opt.vim vim-patch:9.1.0285: Still problems with cursor position for CTRL-D/U 2024-04-09 21:44:42 +02:00
test_scrollbind.vim
test_search_stat.vim
test_search.vim
test_searchpos.vim
test_selectmode.vim
test_set.vim
test_sha256.vim
test_shell.vim
test_shift.vim
test_signals.vim
test_signs.vim
test_sleep.vim
test_smartindent.vim
test_sort.vim
test_source_utf8.vim
test_source.vim
test_spell_utf8.vim
test_spell.vim
test_spellfile.vim
test_startup_utf8.vim
test_startup.vim
test_stat.vim test(old): sleep for 1 second on non-Windows in test_stat.vim (#28195) 2024-04-06 08:33:07 +08:00
test_statusline.vim
test_substitute.vim
test_suspend.vim
test_swap.vim
test_syn_attr.vim
test_syntax.vim fix(treesitter): document more standard highlight groups 2024-03-19 09:41:16 +01:00
test_system.vim
test_tab.vim
test_tabline.vim
test_tabpage.vim vim-patch:9.1.0205: Cannot use modifiers before :-Ntabmove (#28031) 2024-03-26 05:04:57 +08:00
test_tagcase.vim
test_tagfunc.vim
test_tagjump.vim
test_taglist.vim
test_termcodes.vim
test_termdebug.vim
test_textformat.vim
test_textobjects.vim
test_timers.vim
test_true_false.vim
test_trycatch.vim
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_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
test_utf8_comparisons.vim
test_utf8.vim vim-patch:9.1.0334: No test for highlight behavior with 'ambiwidth' (#28354) 2024-04-16 06:50:23 +08:00
test_vartabs.vim
test_version.vim
test_viminfo.vim
test_vimscript.vim
test_virtualedit.vim vim-patch:9.1.0132: "C" doesn't include composing chars with 'virtualedit' (#27605) 2024-02-24 22:04:52 +08:00
test_visual.vim vim-patch:9.1.0220: Few typos in source and test files (#28076) 2024-03-28 19:03:27 +08:00
test_winbuf_close.vim
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_windows_home.vim
test_winfixbuf.vim vim-patch:9.1.0213: CI: MS-Windows fails in test_winfixbuf (#28071) 2024-03-28 17:53:15 +08:00
test_wnext.vim
test_wordcount.vim
test_writefile.vim
test.sh docs: fix typos (#27868) 2024-03-28 09:32:32 +08:00
unix.vim
view_util.vim
vim9.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_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