source shared.vim
source term_util.vim
+" uses line-continuation
+let s:cpo_save = &cpo
+set cpo&vim
+
command -nargs=1 MissingFeature throw 'Skipped: ' .. <args> .. ' feature missing'
" Command to check for the presence of a feature.
throw "Skipped: FIXME: this test doesn't work on Github Actions CI"
endif
endfunc
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
" vim: shiftwidth=2 sts=2 expandtab
" Needed for RunningWithValgrind().
source shared.vim
+" Needed for the various Check commands
+source check.vim
+
" For consistency run all tests with 'nocompatible' set.
" This also enables use of line continuation.
set nocp viminfo+=nviminfo
finish
endif
-source shared.vim
-source term_util.vim
-
" Skip the rest if there is no terminal feature at all.
if !has('terminal')
finish
" NOTE: This just checks if the code works. If you know Arabic please add
" functional tests that check the shaping works with real text.
-source check.vim
CheckFeature arabic
-source view_util.vim
-
" Return list of Unicode characters at line lnum.
" Combining characters are treated as a single item.
func s:get_chars(lnum)
" Test argument list commands
-source check.vim
-source shared.vim
-source term_util.vim
-
func Reset_arglist()
args a | %argd
endfunc
" Test that the methods used for testing work.
-source check.vim
-source term_util.vim
-
func Test_assert_false()
call assert_equal(0, assert_false(0))
call assert_equal(0, assert_false(v:false))
" Test 'autochdir' behavior
-source check.vim
CheckOption autochdir
func Test_set_filename()
" Tests for autocommands
-source shared.vim
-source check.vim
-source term_util.vim
source screendump.vim
import './vim9.vim' as v9
" Tests for the backup function
-source check.vim
-
func Test_backup()
set backup backupdir=. backupskip=
new
" Tests for 'balloonevalterm'.
" A few tests only work in the terminal.
-source check.vim
CheckNotGui
CheckFeature balloon_eval_term
" Tests for 'ballooneval' in the GUI.
-source check.vim
CheckGui
CheckFeature balloon_eval
" Test for benchmarking the RE engine
-source check.vim
CheckFeature reltime
func Measure(file, pattern, arg)
" while the test is run, the breakindent caching gets in its way.
" It helps to change the tabstop setting and force a redraw (e.g. see
" Test_breakindent08())
-source check.vim
CheckOption breakindent
-source view_util.vim
source screendump.vim
func SetUp()
" Tests for Vim buffer
-source check.vim
-
" Test for the :bunload command with an offset
func Test_bunload_with_offset()
%bwipe!
" Tests for setbufline(), getbufline(), appendbufline(), deletebufline()
-source shared.vim
source screendump.vim
-source check.vim
func Test_setbufline_getbufline()
" similar to Test_set_get_bufline()
" Tests for the getbufinfo(), getwininfo() and gettabinfo() functions
-source check.vim
-
func Test_getbufwintabinfo()
CheckFeature quickfix
" Test for :cd and chdir()
-source shared.vim
-source check.vim
-
func Test_cd_large_path()
" This used to crash with a heap write overflow.
call assert_fails('cd ' . repeat('x', 5000), 'E344:')
" Tests for the :cdo, :cfdo, :ldo and :lfdo commands
-source check.vim
CheckFeature quickfix
" Create the files used by the tests
" Test for channel and job functions.
" When +channel is supported then +job is too, so we don't check for that.
-source check.vim
CheckFeature channel
-source shared.vim
source screendump.vim
-source view_util.vim
let s:python = PythonProg()
if s:python == ''
" Tests for the +clientserver feature.
-source check.vim
CheckFeature job
if !has('clientserver')
" Tests for clipmethod
-source check.vim
-source shared.vim
source window_manager.vim
CheckFeature clipboard_working
" Tests for editing the command line.
-source check.vim
source screendump.vim
-source view_util.vim
-source shared.vim
import './vim9.vim' as v9
func SetUp()
" Tests for editing the command line.
-source check.vim
source screendump.vim
func Test_getcmdwintype()
" Test the :compiler command
-source check.vim
-source shared.vim
-
func Test_compiler()
CheckExecutable perl
CheckFeature quickfix
" Tests for 'conceal'.
-source check.vim
CheckFeature conceal
source screendump.vim
-source view_util.vim
func Test_conceal_two_windows()
CheckScreendump
" Test for the various 'cpoptions' (cpo) flags
-source check.vim
-source shared.vim
-source view_util.vim
-
" Test for the 'a' flag in 'cpo'. Reading a file should set the alternate
" file name.
func Test_cpo_a()
" Some tests, that used to crash Vim
-source check.vim
source screendump.vim
CheckScreendump
" Tests for encryption.
-source shared.vim
-source check.vim
CheckFeature cryptv
" Use the xxd command from:
" Test for cscope commands.
-source check.vim
CheckFeature cscope
CheckFeature quickfix
CheckExecutable cscope
" Tests for cursor() and other functions that get/set the cursor position
-source check.vim
-
func Test_wrong_arguments()
call assert_fails('call cursor(1. 3)', 'E474:')
call assert_fails('call cursor(test_null_list())', 'E474:')
" Test for cursorline and cursorlineopt
-source check.vim
source screendump.vim
func s:screen_attr(lnum) abort
" Tests for not changing curswant
-source check.vim
-source term_util.vim
-
func Test_curswant()
new
call append(0, ['1234567890', '12345'])
" Tests for the Vim script debug commands
-source shared.vim
source screendump.vim
-source check.vim
CheckRunVimInTerminal
" Test for delete().
-source check.vim
-source term_util.vim
source screendump.vim
func Test_file_delete()
" Tests for diff mode
-source shared.vim
source screendump.vim
-source check.vim
-source view_util.vim
func Test_diff_fold_sync()
enew!
" Tests for digraphs
-source check.vim
CheckFeature digraphs
-source term_util.vim
func Put_Dig(chars)
exe "norm! o\<c-k>".a:chars
set term=ansi
endif
-source view_util.vim
-source check.vim
source screendump.vim
func Test_display_foldcolumn()
let &t_kD="\e[3;*~"
endif
-source check.vim
source screendump.vim
-source view_util.vim
" Needs to come first until the bug in getchar() is
" fixed: https://groups.google.com/d/msg/vim_dev/fXL9yme4H4c/bOR-U6_bAQAJ
scriptencoding utf-8
-source check.vim
-
func Test_environ()
unlet! $TESTENV
call assert_equal(0, has_key(environ(), 'TESTENV'))
" Test whether glob()/globpath() return correct results with certain escaped
" characters.
-source check.vim
-
func SetUp()
" consistent sorting of file names
set nofileignorecase
" Tests for various eval things.
-source view_util.vim
source shared.vim
import './vim9.vim' as v9
" Test editing line in Ex mode (see :help Q and :help gQ).
-source check.vim
-source shared.vim
-
" Helper function to test editing line in Q Ex mode
func Ex_Q(cmd)
" Is there a simpler way to test editing Ex line?
" Tests for various Ex commands.
-source check.vim
-source shared.vim
-source term_util.vim
source screendump.vim
func Test_ex_delete()
" test execute()
-source view_util.vim
-source check.vim
import './vim9.vim' as v9
-source term_util.vim
func NestedEval()
let nested = execute('echo "nested\nlines"')
" Tests for exiting Vim.
-source shared.vim
-source check.vim
-
func Test_exiting()
let after =<< trim [CODE]
au QuitPre * call writefile(["QuitPre"], "Xtestout")
" Test for expanding file names
-source shared.vim
-source check.vim
-
func Test_with_directories()
call mkdir('Xdir1')
call mkdir('Xdir2')
" Tests for expand()
-source shared.vim
-
let s:sfile = expand('<sfile>')
let s:slnum = str2nr(expand('<slnum>'))
let s:sflnum = str2nr(expand('<sflnum>'))
" This test depends on the location in the test file, put it first.
func Test_expand_sflnum()
- call assert_equal(7, s:sflnum)
- call assert_equal(24, str2nr(expand('<sflnum>')))
+ call assert_equal(5, s:sflnum)
+ call assert_equal(22, str2nr(expand('<sflnum>')))
" Line-continuation
call assert_equal(
- \ 27,
+ \ 25,
\ str2nr(expand('<sflnum>')))
" Call in script-local function
- call assert_equal(18, s:expand_sflnum())
+ call assert_equal(16, s:expand_sflnum())
" Call in command
command Flnum echo expand('<sflnum>')
- call assert_equal(36, str2nr(trim(execute('Flnum'))))
+ call assert_equal(34, str2nr(trim(execute('Flnum'))))
delcommand Flnum
endfunc
endfunc
func Test_expand_slnum()
- call assert_equal(6, s:slnum)
+ call assert_equal(4, s:slnum)
call assert_equal(2, str2nr(expand('<slnum>')))
" Line-continuation
" Tests for expressions.
-source check.vim
import './vim9.vim' as v9
func Test_equal()
" cksum is part of POSIX and so should be available on most Unixes.
" If it isn't available then the test will be skipped.
-source check.vim
-
func Test_File_Size()
CheckExecutable cksum
" Tests for when a file was changed outside of Vim.
-source check.vim
-
func Test_FileChangedShell_reload()
CheckUnix
" Test filecopy()
-source check.vim
-source shared.vim
-
func Test_copy_file_to_file()
call writefile(['foo'], 'Xcopy1')
" Test for 'fileformat'
-source shared.vim
-
" Test behavior of fileformat after bwipeout of last buffer
func Test_fileformat_after_bw()
bwipeout
" Test the :filter command modifier
-source check.vim
-
func Test_filter()
edit Xdoesnotmatch
edit Xwillmatch
" Test findfile() and finddir()
-source check.vim
import './vim9.vim' as v9
let s:files = [ 'Xfinddir1/foo',
" test float functions
-source check.vim
import './vim9.vim' as v9
func Test_abs()
" Test for folding
-source check.vim
-source view_util.vim
source screendump.vim
func PrepIndent(arg)
" Tests for expressions.
-source check.vim
import './vim9.vim' as v9
func Test_printf_pos_misc()
" Tests for various functions.
-source shared.vim
-source check.vim
-source term_util.vim
source screendump.vim
import './vim9.vim' as v9
-source check.vim
+" Test for gettext()
CheckFeature gettext
-" Test for gettext()
func Test_gettext()
call assert_fails('call bindtextdomain("test")', 'E119:')
call assert_fails('call bindtextdomain("vim", "test")', 'E475:')
-source check.vim
" This fail on CI MacOS 14 because bindtextdomain() is not available there
" (missing library?)
CheckNotMac
-source check.vim
CheckNotMac
CheckFeature gettext
-source check.vim
" This fail on CI MacOS 14 because bindtextdomain() is not available there
" (missing library?)
CheckNotMac
" Test for :global and :vglobal
-source check.vim
-source term_util.vim
-
func Test_yank_put_clipboard()
new
call setline(1, ['a', 'b', 'c'])
" Tests specifically for the GUI
-source shared.vim
-source check.vim
CheckCanRunGui
source setup_gui.vim
" Tests specifically for the GUI features/options that need to be set up at
" startup to take effect at runtime.
-source shared.vim
-source check.vim
CheckCanRunGui
source setup_gui.vim
" Test :hardcopy
-source check.vim
-
func Test_printoptions()
edit test_hardcopy.vim
syn on
" Tests for :help
-source check.vim
import './vim9.vim' as v9
func Test_help_restore_snapshot()
" Tests for ":highlight" and highlighting.
-source view_util.vim
source screendump.vim
-source check.vim
source script_util.vim
import './vim9.vim' as v9
" Tests for the history functions
-source check.vim
CheckFeature cmdline_hist
set history=7
" Test for v:hlsearch
-source check.vim
source screendump.vim
func Test_hlsearch()
" Test for 'iminsert'
-source view_util.vim
-source check.vim
import './vim9.vim' as v9
let s:imactivatefunc_called = 0
" Test for various indent options
-source shared.vim
-source check.vim
-
func Test_preserveindent()
new
" Test for autoindent copying indent from the previous line
" Test for insert completion
source screendump.vim
-source check.vim
import './vim9.vim' as v9
" Test for insert expansion
" leaks under valgrind. That is because when fork/exec fails memory is not
" freed. Since the process exits right away it's not a real leak.
-source check.vim
-
func Test_job_start_fails()
CheckFeature job
let job = job_start('axdfxsdf')
" Test for lambda and closure
-source check.vim
import './vim9.vim' as v9
func Test_lambda_feature()
" tests for 'langmap'
-source check.vim
CheckFeature langmap
func Test_langmap()
" Tests for 'listchars' display with 'list' and :list
-source check.vim
-source view_util.vim
source screendump.vim
func Check_listchars(expected, end_lnum, end_scol = -1, leftcol = 0)
set encoding=latin1
scriptencoding latin1
-source check.vim
CheckOption linebreak
CheckFeature conceal
-source view_util.vim
source screendump.vim
function s:screen_lines(lnum, width) abort
set encoding=utf-8
scriptencoding utf-8
-source check.vim
CheckOption linebreak
CheckFeature conceal
CheckFeature signs
-source view_util.vim
source screendump.vim
func s:screen_lines(lnum, width) abort
" Tests for Lua.
-source check.vim
-
" This test also works without the lua feature.
func Test_skip_lua()
if 0
" Tests for 'makeencoding'.
-source shared.vim
-source check.vim
-
CheckFeature quickfix
let s:python = PythonProg()
if s:python == ''
" Tests for maparg(), mapcheck(), mapset(), maplist()
" Also test utf8 map with a 0x80 byte.
-source shared.vim
-
func s:SID()
return str2nr(matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$'))
endfunc
" Tests for mappings and abbreviations
-source shared.vim
-source check.vim
source screendump.vim
-source term_util.vim
import './vim9.vim' as v9
func Test_abbreviation()
" matchaddpos(), matcharg(), matchdelete(), and setmatches().
source screendump.vim
-source check.vim
function Test_match()
highlight MyGroup1 term=bold ctermbg=red guibg=red
" Test for matchadd() and conceal feature
-source check.vim
CheckFeature conceal
if !has('gui_running') && has('unix')
set term=ansi
endif
-source shared.vim
-source term_util.vim
-source view_util.vim
-
func Test_simple_matchadd()
new
" Test for matchadd() and conceal feature using utf-8.
-source check.vim
CheckFeature conceal
if !has('gui_running') && has('unix')
" Tests for fuzzy matching
-source shared.vim
-source check.vim
-source term_util.vim
-
" Test for matchfuzzy()
func Test_matchfuzzy()
call assert_fails('call matchfuzzy(10, "abc")', 'E686:')
" Tests for memory usage.
-source check.vim
CheckFeature terminal
CheckNotGui
" usage.
CheckNotAsan
-source shared.vim
-
func s:pick_nr(str) abort
return substitute(a:str, '[^0-9]', '', 'g') * 1
endfunc
" Test that the system menu can be loaded.
-source check.vim
CheckFeature menu
source screendump.vim
" Tests for :messages, :echomsg, :echoerr
-source check.vim
-source shared.vim
-source term_util.vim
-source view_util.vim
source screendump.vim
func Test_messages()
" Tests for ->method()
-source check.vim
-
func Test_list_method()
let l = [1, 2, 3]
call assert_equal([1, 2, 3, 4], [1, 2, 3]->add(4))
set encoding=latin1
scriptencoding latin1
-source check.vim
CheckFeature mksession
-source shared.vim
-source term_util.vim
-
" Test for storing global and local argument list in a session file
" This one must be done first.
func Test__mksession_arglocal()
set encoding=utf-8
scriptencoding utf-8
-source check.vim
CheckFeature mksession
func Test_mksession_utf8()
" Test for modeless selection
" This only works for Unix in a terminal
-source check.vim
CheckNotGui
CheckUnix
-source shared.vim
source mouse.vim
" Test for modeless characterwise selection (single click)
" Tests for parsing the modeline.
-source check.vim
-
func Test_modeline_invalid()
" This was reading allocated memory in the past.
call writefile(['vi:0', 'nothing'], 'Xmodeline', 'D')
" Test the ":move" command.
-source check.vim
source screendump.vim
func Test_move()
" Test MS-Windows input event handling.
" Most of this works the same in Windows GUI as well as Windows console.
-source check.vim
CheckMSWindows
source mouse.vim
" Test for MzScheme interface and mzeval() function
-source check.vim
CheckFeature mzscheme
func MzRequire()
" Tests for nested functions
-source check.vim
-
func NestedFunc()
func! Func1()
let g:text .= 'Func1 '
" Test the netbeans interface.
-source check.vim
CheckFeature netbeans_intg
-source shared.vim
-
let s:python = PythonProg()
if s:python == ''
throw 'Skipped: python program missing'
" Test for various Normal mode commands
-source shared.vim
-source check.vim
-source view_util.vim
import './vim9.vim' as v9
source screendump.vim
" Test for 'number' and 'relativenumber'
-source check.vim
-source view_util.vim
-
source screendump.vim
func s:screen_lines(start, end) abort
" Test for options
-source shared.vim
-source check.vim
-source view_util.vim
-
scriptencoding utf-8
func Test_whichwrap()
" Tests for 'packpath' and :packadd
-source check.vim
-
func SetUp()
let s:topdir = getcwd() . '/Xppdir'
exe 'set packpath=' . s:topdir
" Test binding arguments to a Funcref.
-source check.vim
-
func MyFunc(arg1, arg2, arg3)
return a:arg1 . '/' . a:arg2 . '/' . a:arg3
endfunc
" Tests for bracketed paste and other forms of pasting.
" Bracketed paste only works with "xterm". Not in GUI or Windows console.
-source check.vim
-source term_util.vim
CheckNotMSWindows
CheckNotGui
set term=xterm
-source shared.vim
-
func Test_paste_normal_mode()
new
" In first column text is inserted
" Tests for Perl interface
-source check.vim
-source shared.vim
CheckFeature perl
" FIXME: RunTest don't see any error when Perl abort...
" Test for the comment package
-source check.vim
-source term_util.vim
-
func Test_basic_comment()
CheckScreendump
let lines =<< trim END
set term=ansi
endif
-source view_util.vim
-source check.vim
source screendump.vim
" Test for scrolling that modifies buffer during visual block
" Test for the termdebug plugin
-source shared.vim
source screendump.vim
-source check.vim
CheckUnix
CheckFeature terminal
" Tests for Vim :TOhtml
-source check.vim
-
func s:setup_basic(src_name)
let lines =<< trim END
#include <stdio.h>
" Test for the new-tutor plugin
source screendump.vim
-source check.vim
source script_util.vim
func SetUp()
-so check.vim
-
CheckExecutable unzip
if 0 " Find uncovered line
" Test for completion menu
-source shared.vim
source screendump.vim
-source check.vim
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
let g:setting = ''
" Tests for popup windows
-source check.vim
CheckFeature popupwin
source screendump.vim
-source term_util.vim
func Test_simple_popup()
CheckScreendump
" Tests for popup windows for text properties
-source check.vim
CheckFeature popupwin
CheckFeature textprop
" Tests for the preview window
-source check.vim
CheckFeature quickfix
func Test_Psearch()
" Test Vim profiler
-source check.vim
CheckFeature profile
-source shared.vim
source screendump.vim
if has('prof_nsec')
" Tests for setting 'buftype' to "prompt"
-source check.vim
CheckFeature channel
-source shared.vim
source screendump.vim
func CanTestPromptBuffer()
" Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc.
-source check.vim
source screendump.vim
func Test_put_block()
" Test for python 2 commands.
-source check.vim
CheckFeature python
CheckFeature quickfix
-source shared.vim
" NOTE: This will cause errors when run under valgrind.
" This would require recompiling Python with:
" Test for python 3 commands.
-source check.vim
CheckFeature python3
-source shared.vim
func Create_vim_list()
return [1]
" Test for pyx* commands and functions with Python 2.
set pyx=2
-source check.vim
CheckFeature python
let s:py2pattern = '^2\.[0-7]\.\d\+'
" Test for pyx* commands and functions with Python 3.
set pyx=3
-source check.vim
CheckFeature python3
let s:py2pattern = '^2\.[0-7]\.\d\+'
" Test for the quickfix feature.
-source check.vim
import './vim9.vim' as v9
CheckFeature quickfix
" *-register (quotestar) tests
-source shared.vim
-source check.vim
-
CheckFeature clipboard_working
func Do_test_quotestar_for_macunix()
" Tests for srand() and rand()
-source check.vim
-source shared.vim
-
func Test_Rand()
let r = srand(123456789)
call assert_equal([1573771921, 319883699, 2742014374, 1324369493], r)
" Test :recover
-source check.vim
-
func Test_recover_root_dir()
" This used to access invalid memory.
split Xtest
" Tests for regexp with backslash and other special characters inside []
" Also test backslash for hex/octal numbered character.
-"
scriptencoding utf-8
quit!
endfunction
-
function Test_x_search()
let res = "test text test text"
call RunXTest("test \\text test text", "/[\\x]", res)
set encoding=latin1
scriptencoding latin1
-source check.vim
-
func s:equivalence_test()
let str = 'AÀÁÂÃÄÅ B C D EÈÉÊË F G H IÌÍÎÏ J K L M NÑ OÒÓÔÕÖØ P Q R S T UÙÚÛÜ V W X YÝ Z '
\ .. 'aàáâãäå b c d eèéêë f g h iìíîï j k l m nñ oòóôõöø p q r s t uùúûü v w x yýÿ z '
" Tests for regexp in utf8 encoding
-source shared.vim
-
func s:equivalence_test()
let str = "AÀÁÂÃÄÅĀĂĄǍǞǠǺȂȦȺḀẠẢẤẦẨẪẬẮẰẲẴẶ BƁɃḂḄḆ CÇĆĈĊČƇȻḈꞒ DĎĐƊḊḌḎḐḒ EÈÉÊËĒĔĖĘĚȄȆȨɆḔḖḘḚḜẸẺẼẾỀỂỄỆ FƑḞꞘ GĜĞĠĢƓǤǦǴḠꞠ HĤĦȞḢḤḦḨḪⱧ IÌÍÎÏĨĪĬĮİƗǏȈȊḬḮỈỊ JĴɈ KĶƘǨḰḲḴⱩꝀ LĹĻĽĿŁȽḶḸḺḼⱠ MḾṀṂ NÑŃŅŇǸṄṆṈṊꞤ OÒÓÔÕÖØŌŎŐƟƠǑǪǬǾȌȎȪȬȮȰṌṎṐṒỌỎỐỒỔỖỘỚỜỞỠỢ PƤṔṖⱣ QɊ RŔŖŘȐȒɌṘṚṜṞⱤꞦ SŚŜŞŠȘṠṢṤṦṨⱾꞨ TŢŤŦƬƮȚȾṪṬṮṰ UÙÚÛÜŨŪŬŮŰƯǕǙǛǓǗȔȖɄṲṴṶṸṺỤỦỨỪỬỮỰ VƲṼṾ WŴẀẂẄẆẈ XẊẌ YÝŶŸƳȲɎẎỲỴỶỸ ZŹŻŽƵẐẒẔⱫ aàáâãäåāăąǎǟǡǻȃȧᶏḁẚạảấầẩẫậắằẳẵặⱥ bƀɓᵬᶀḃḅḇ cçćĉċčƈȼḉꞓꞔ dďđɗᵭᶁᶑḋḍḏḑḓ eèéêëēĕėęěȅȇȩɇᶒḕḗḙḛḝẹẻẽếềểễệ fƒᵮᶂḟꞙ gĝğġģǥǧǵɠᶃḡꞡ hĥħȟḣḥḧḩḫẖⱨꞕ iìíîïĩīĭįǐȉȋɨᶖḭḯỉị jĵǰɉ kķƙǩᶄḱḳḵⱪꝁ lĺļľŀłƚḷḹḻḽⱡ mᵯḿṁṃ nñńņňʼnǹᵰᶇṅṇṉṋꞥ oòóôõöøōŏőơǒǫǭǿȍȏȫȭȯȱɵṍṏṑṓọỏốồổỗộớờởỡợ pƥᵱᵽᶈṕṗ qɋʠ rŕŗřȑȓɍɽᵲᵳᶉṛṝṟꞧ sśŝşšșȿᵴᶊṡṣṥṧṩꞩ tţťŧƫƭțʈᵵṫṭṯṱẗⱦ uùúûüũūŭůűųǚǖưǔǘǜȕȗʉᵾᶙṳṵṷṹṻụủứừửữự vʋᶌṽṿ wŵẁẃẅẇẉẘ xẋẍ yýÿŷƴȳɏẏẙỳỵỷỹ zźżžƶᵶᶎẑẓẕⱬ"
let groups = split(str)
" Tests for register operations
-source check.vim
-source view_util.vim
-
" This test must be executed first to check for empty and unset registers.
func Test_aaa_empty_reg_test()
call assert_fails('normal @@', 'E748:')
" Tests for reltime()
-source check.vim
CheckFeature reltime
func Test_reltime()
" Test for the --remote functionality
-source check.vim
CheckFeature clientserver
CheckFeature terminal
-source shared.vim
source screendump.vim
source mouse.vim
-source term_util.vim
let s:remote_works = 0
let s:skip = 'Skipped: --remote feature is not possible'
" Test rename()
-source shared.vim
-
func Test_rename_file_to_file()
call writefile(['foo'], 'Xrename1')
" Test for "rvim" or "vim -Z"
-source shared.vim
-
"if has('win32') && has('gui')
" " Win32 GUI shows a dialog instead of displaying the error in the last line.
" finish
" Test :retab
-source check.vim
-
func SetUp()
new
call setline(1, "\ta \t b c ")
" Tests for ruby interface
-source check.vim
CheckFeature ruby
func Test_ruby_change_buffer()
" Test for 'scroll', 'scrolloff', 'smoothscroll', etc.
-source check.vim
source screendump.vim
source mouse.vim
" Test for the search command
-source shared.vim
source screendump.vim
-source check.vim
func Test_search_cmdline()
CheckOption incsearch
" Tests for search_stats, when "S" is not in 'shortmess'
-source check.vim
source screendump.vim
func Test_search_stat()
" Test for Select-mode
" This only works for Unix in a terminal
-source check.vim
CheckNotGui
CheckUnix
" Tests for the :set command
-source check.vim
-
function Test_set_backslash()
let isk_save = &isk
" Tests for the sha256() function.
-source check.vim
CheckFeature cryptv
CheckFunction sha256
" Test for the shell related options ('shell', 'shellcmdflag', 'shellpipe',
" 'shellquote', 'shellredir', 'shellxescape', and 'shellxquote')
-source check.vim
-source shared.vim
-
func Test_shell_options()
if has('win32')
" FIXME: This test is flaky on MS-Windows.
" Test shifting lines with :> and :<
-source check.vim
-
func Test_ex_shift_right()
set shiftwidth=2
set encoding=utf-8
scriptencoding utf-8
-source check.vim
CheckMSWindows
func TestIt(file, bits, expected)
" Test signal handling.
-source check.vim
-source term_util.vim
-
CheckUnix
-source shared.vim
-
" Check whether a signal is available on this system.
func HasSignal(signal)
let signals = system('kill -l')
" Test for signs
-source check.vim
CheckFeature signs
source screendump.vim
" Tests for the "sort()" function and for the ":sort" command.
-source check.vim
-
func Compare1(a, b) abort
call sort(range(3), 'Compare2')
return a:a - a:b
" Tests for the sound feature
-source check.vim
-source shared.vim
-
CheckFeature sound
func PlayCallback(id, result)
" Tests for the :source command.
-source check.vim
-source view_util.vim
-
func Test_source_autocmd()
call writefile([
\ 'let did_source = 1',
" Test the :source! command
-source check.vim
-
func Test_source_utf8()
" check that sourcing a script with 0x80 as second byte works
new
" Test spell checking
" Note: this file uses latin1 encoding, but is used with utf-8 encoding.
-source check.vim
CheckFeature spell
source screendump.vim
-source view_util.vim
func TearDown()
set nospell
" Test for spell checking with 'encoding' set to utf-8
-source check.vim
CheckFeature spell
scriptencoding utf-8
" Test for commands that operate on the spellfile.
-source shared.vim
-source check.vim
-
CheckFeature spell
CheckFeature syntax
" Test spell checking
-source check.vim
CheckFeature spell
" Test spellbadword() with argument, specifically to move to "rare" words
" Tests for startup.
-source shared.vim
source screendump.vim
-source term_util.vim
-source check.vim
" Check that loading startup.vim works.
func Test_startup_script()
" Tests for startup using utf-8.
-source check.vim
-source shared.vim
source screendump.vim
func Test_read_stdin_utf8()
" Tests for stat functions and checktime
-source check.vim
-
func CheckFileTime(doSleep)
let fnames = ['Xtest1.tmp', 'Xtest2.tmp', 'Xtest3.tmp']
let times = []
" Not tested yet:
" %N
-source view_util.vim
-source check.vim
source screendump.vim
func SetUp()
" Tests for the substitute (:s) command
-source shared.vim
-source check.vim
source screendump.vim
" NOTE: This needs to be the first test to be
" Test :suspend
-source check.vim
-source term_util.vim
-source shared.vim
-
func CheckSuspended(buf, fileExists)
call WaitForAssert({-> assert_match('[$#] $', term_getline(a:buf, '.'))})
" Tests for the swap feature
-source check.vim
-source shared.vim
-source term_util.vim
-
func s:swapname()
return trim(execute('swapname'))
endfunc
" Test for syntax and syntax iskeyword option
-source check.vim
CheckFeature syntax
-source view_util.vim
source screendump.vim
func GetSyntaxItem(pat)
" Tests for system() and systemlist()
-source shared.vim
-source check.vim
-
func Test_System()
if !has('win32')
call assert_equal("123\n", system('echo 123'))
" Test for tabline
-source shared.vim
-source view_util.vim
-source check.vim
source screendump.vim
func TablineWithCaughtError()
" Tests for tabpage
source screendump.vim
-source check.vim
function Test_tabpage()
CheckFeature quickfix
" Tests for tabpanel
-source check.vim
source screendump.vim
CheckFeature tabpanel
" Test 'tagfunc'
import './vim9.vim' as v9
-source check.vim
source screendump.vim
func TagFunc(pat, flag, info)
" Tests for tagjump (tags and special searches)
-source check.vim
source screendump.vim
" SEGV occurs in older versions. (At least 7.4.1748 or older)
" test taglist(), tagfiles() functions and :tags command
-source check.vim
-source view_util.vim
-
func Test_taglist()
call writefile([
\ "FFoo\tXfoo\t1",
" Tests for the Tcl interface.
-source check.vim
CheckFeature tcl
" Helper function as there is no builtin tcleval() function similar
" Tests for decoding escape sequences sent by the terminal.
" This only works for Unix in a terminal
-source check.vim
CheckNotGui
CheckUnix
-source shared.vim
source mouse.vim
-source view_util.vim
-source term_util.vim
func s:TermGuiColorsTest()
CheckNotMSWindows
" Test for setting 'encoding' to something else than the terminal uses, then
" setting 'termencoding' to make it work.
-source check.vim
-
" This only works with "iconv".
CheckFeature iconv
" This is split in two, because it can take a lot of time.
" See test_terminal2.vim and test_terminal3.vim for further tests.
-source check.vim
CheckFeature terminal
-source shared.vim
source screendump.vim
source mouse.vim
-source term_util.vim
let s:python = PythonProg()
let $PROMPT_COMMAND=''
" This is split in two, because it can take a lot of time.
" See test_terminal.vim and test_terminal3.vim for further tests.
-source check.vim
CheckFeature terminal
-source shared.vim
source screendump.vim
source mouse.vim
-source term_util.vim
let $PROMPT_COMMAND=''
" This is split in two, because it can take a lot of time.
" See test_terminal.vim and test_terminal2.vim for further tests.
-source check.vim
CheckFeature terminal
-source shared.vim
source screendump.vim
source mouse.vim
-source term_util.vim
import './vim9.vim' as v9
" leaks under valgrind. That is because when fork/exec fails memory is not
" freed. Since the process exits right away it's not a real leak.
-source check.vim
CheckFeature terminal
source shared.vim
" Tests for the various 'formatoptions' settings
-source check.vim
-
func Test_text_format()
enew!
" Test for textobjects
-source check.vim
-
func CpoM(line, useM, expected)
new
" Tests for defining text property types and adding text properties to the
" buffer.
-source check.vim
CheckFeature textprop
source screendump.vim
" Test for timers
-source check.vim
CheckFeature timers
source screendump.vim
-source shared.vim
-source term_util.vim
func SetUp()
" The tests here use timers, thus are sensitive to timing.
" Test behavior of boolean-like values.
-source check.vim
-
" Test what is explained at ":help TRUE" and ":help FALSE".
func Test_if()
if v:false
" Test try-catch-finally exception handling
" Most of this was formerly in test49.
-source check.vim
-source shared.vim
import './vim9.vim' as v9
"-------------------------------------------------------------------------------
" undo-able pieces. Do that by setting 'undolevels'.
" Also tests :earlier and :later.
-source check.vim
source screendump.vim
func Test_undotree()
" Tests for the ":uniq" command.
-source check.vim
-
" Tests for the ":uniq" command.
func Test_uniq_cmd()
let tests = [
" Also test that a builtin function cannot be replaced.
" Also test for regression when calling arbitrary expression.
-source check.vim
-source shared.vim
import './vim9.vim' as v9
func Table(title, ...)
import './vim9.vim' as v9
-source check.vim
source screendump.vim
" Test for <mods> in user defined commands
" Tests for Unicode manipulations
-source check.vim
-source view_util.vim
source screendump.vim
" Visual block Insert adjusts for multi-byte char
" Test for variable tabstops
-source check.vim
CheckFeature vartabs
-source view_util.vim
-
func s:compare_lines(expect, actual)
call assert_equal(join(a:expect, "\n"), join(a:actual, "\n"))
endfunc
" Test :version Ex command
-so check.vim
-so shared.vim
-
func Test_version()
" version should always return the same string.
let v1 = execute('version')
" Test Vim9 assignments
-source check.vim
import './vim9.vim' as v9
-source term_util.vim
let s:appendToMe = 'xxx'
let s:addToMe = 111
" Test using builtin functions in the Vim9 script language.
-source check.vim
source screendump.vim
import './vim9.vim' as v9
" Test Vim9 classes
-source check.vim
import './vim9.vim' as v9
def Test_class_basic()
" Test commands that are not compiled in a :def function
-source check.vim
import './vim9.vim' as v9
-source term_util.vim
-source view_util.vim
def Test_vim9cmd()
var lines =<< trim END
" Test the :disassemble command, and compilation as a side effect
-source check.vim
import './vim9.vim' as v9
func s:NotCompiled()
" Test Vim9 enums
-source check.vim
import './vim9.vim' as v9
" Test for parsing an enum definition
" Tests for Vim9 script expressions
-source check.vim
import './vim9.vim' as v9
let g:cond = v:false
" Test for Vim9 script with failures, causing memory leaks to be reported.
" The leaks happen after a fork() and can be ignored.
-source check.vim
-
def Test_assignment()
if !has('channel')
CheckFeature channel
" Test various aspects of the Vim9 script language.
-source check.vim
-source term_util.vim
-source view_util.vim
import './vim9.vim' as v9
source screendump.vim
" Test import/export of the Vim9 script language.
" Also the autoload mechanism.
-source check.vim
-source term_util.vim
import './vim9.vim' as v9
let s:export_script_lines =<< trim END
-source check.vim
import './vim9.vim' as v9
CheckFeature python3
" Test various aspects of the Vim9 script language.
-source check.vim
-source term_util.vim
import './vim9.vim' as v9
source screendump.vim
-source shared.vim
def Test_vim9script_feature()
# example from the help, here the feature is always present
" Test Vim9 type aliases
-source check.vim
import './vim9.vim' as v9
" Test for :type command to create type aliases
" Test for reading and writing .viminfo
-source check.vim
-source term_util.vim
-source shared.vim
-
func Test_viminfo_read_and_write()
" First clear 'history', so that "hislen" is zero. Then set it again,
" simulating Vim starting up.
" Most of this was formerly in test49.vim (developed by Servatius Brandt
" <Servatius.Brandt@fujitsu-siemens.com>)
-source check.vim
-source shared.vim
source script_util.vim
"-------------------------------------------------------------------------------
" Tests for various Visual modes.
-source shared.vim
-source check.vim
source screendump.vim
import './vim9.vim' as v9
-source check.vim
-source shared.vim
source window_manager.vim
CheckFeature wayland
" Test WinBar
-source check.vim
CheckFeature menu
-source shared.vim
source screendump.vim
func Test_add_remove_menu()
" Tests for window cmd (:wincmd, :split, :vsplit, :resize and etc...)
-source check.vim
source screendump.vim
func Test_window_cmd_ls0_with_split()
" Test using the window ID.
-source check.vim
-
func Test_win_getid()
edit one
let id1 = win_getid()
" Test for $HOME on Windows.
-source check.vim
CheckMSWindows
let s:env = {}
" Test 'winfixbuf'
-source check.vim
-source shared.vim
-
" Find the number of open windows in the current tab
func s:get_windows_count()
return tabpagewinnr(tabpagenr(), '$')
" Tests for the writefile() function and some :write commands.
-source check.vim
-source term_util.vim
-
func Test_writefile()
let f = tempname()
call writefile(["over", "written"], f, "bD")
" Tests for the XDG feature
-source check.vim
-source shared.vim
-
func s:get_rcs()
let rcs = {
\ 'file1': { 'path': '~/.vimrc', 'dir': expand('~/.vim/') },
" Test for the xxd command
-source check.vim
source screendump.vim
if empty($XXD) && executable('..\xxd\xxd.exe')
-source check.vim
-source shared.vim
-
CheckFeature job
CheckUnix
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1524,
/**/
1523,
/**/