text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: test/old/testdir/test_getcwd.vim
func GetCwdInfo(win, tab)
let tab_changed = 0
let mod = ":t"
if a:tab > 0 && a:tab != tabpagenr()
let tab_changed = 1
exec "tabnext " . a:tab
endif
let bufname = fnamemodify(bufname(winbufnr(a:win)), mod)
if tab_changed
tabprevious
endif
if a:win ==... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_getcwd.vim", "license": "mit", "size": 3226} |
### File: test/old/testdir/test_getvar.vim
" Tests for getwinvar(), gettabvar(), gettabwinvar() and get().
func Test_var()
" Use strings to test for memory leaks. First, check that in an empty
" window, gettabvar() returns the correct value
let t:testvar='abcd'
call assert_equal('abcd', gettabvar(1, 'testvar'... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_getvar.vim", "license": "mit", "size": 5691} |
### File: test/old/testdir/test_gf.vim
" Test for the gf and gF (goto file) commands
" This is a test if a URL is recognized by "gf", with the cursor before and
" after the "://". Also test ":\\".
func Test_gf_url()
enew!
call append(0, [
\ "first test for URL://machine.name/tmp/vimtest2a and other text",
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_gf.vim", "license": "mit", "size": 9665} |
### File: test/old/testdir/test_glob2regpat.vim
" Test glob2regpat()
source vim9.vim
func Test_glob2regpat_invalid()
if has('float')
call assert_equal('^1\.33$', glob2regpat(1.33))
call CheckDefExecAndScriptFailure(['echo glob2regpat(1.33)'], 'E806:')
endif
call assert_fails('call glob2regpat("}")', 'E2... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_glob2regpat.vim", "license": "mit", "size": 1436} |
### File: test/old/testdir/test_global.vim
" Test for :global and :vglobal
source check.vim
source term_util.vim
func Test_yank_put_clipboard()
new
call setline(1, ['a', 'b', 'c'])
set clipboard=unnamed
g/^/normal yyp
call assert_equal(['a', 'a', 'b', 'b', 'c', 'c'], getline(1, 6))
set clipboard=unnamed,u... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_global.vim", "license": "mit", "size": 3644} |
### File: test/old/testdir/test_gn.vim
" Test for gn command
func Test_gn_command()
noautocmd new
" replace a single char by itself quoted:
call setline('.', 'abc x def x ghi x jkl')
let @/ = 'x'
exe "norm! cgn'x'\<esc>.."
call assert_equal("abc 'x' def 'x' ghi 'x' jkl", getline('.'))
sil! %d_
" simpl... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_gn.vim", "license": "mit", "size": 5610} |
### File: test/old/testdir/test_goto.vim
" Test commands that jump somewhere.
" Create a new buffer using "lines" and place the cursor on the word after the
" first occurrence of return and invoke "cmd". The cursor should now be
" positioned at the given line and col.
func XTest_goto_decl(cmd, lines, line, col)
new
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_goto.vim", "license": "mit", "size": 7708} |
### File: test/old/testdir/test_gui.vim
func Test_colorscheme()
" call assert_equal('16777216', &t_Co)
let colorscheme_saved = exists('g:colors_name') ? g:colors_name : 'default'
let g:color_count = 0
augroup TestColors
au!
au ColorScheme * let g:color_count += 1
\ | let g:after_color... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_gui.vim", "license": "mit", "size": 1510} |
### File: test/old/testdir/test_help.vim
" Tests for :help
source check.vim
source vim9.vim
func SetUp()
let s:vimruntime = $VIMRUNTIME
let s:runtimepath = &runtimepath
" Set $VIMRUNTIME to $BUILD_DIR/runtime and remove the original $VIMRUNTIME
" path from &runtimepath so that ":h local-additions" won't pick ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_help.vim", "license": "mit", "size": 5920} |
### File: test/old/testdir/test_help_tagjump.vim
" Tests for :help! {subject}
func Test_help_tagjump()
help
call assert_equal("help", &filetype)
call assert_true(getline('.') =~ '\*help.txt\*')
helpclose
help |
call assert_equal("help", &filetype)
call assert_true(getline('.') =~ '\*bar\*')
helpclose
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_help_tagjump.vim", "license": "mit", "size": 8628} |
### File: test/old/testdir/test_hide.vim
" Tests for :hide command/modifier and 'hidden' option
func SetUp()
let s:save_hidden = &hidden
let s:save_bufhidden = &bufhidden
let s:save_autowrite = &autowrite
set nohidden
set bufhidden=
set noautowrite
endfunc
function TearDown()
let &hidden = s:save_hidden... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_hide.vim", "license": "mit", "size": 2443} |
### File: test/old/testdir/test_highlight.vim
" Tests for ":highlight" and highlighting.
source view_util.vim
source screendump.vim
source check.vim
source script_util.vim
func Test_highlight()
" basic test if ":highlight" doesn't crash
highlight
hi Search
" test setting colors.
" test clearing one color a... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_highlight.vim", "license": "mit", "size": 28674} |
### File: test/old/testdir/test_history.vim
" Tests for the history functions
source check.vim
CheckFeature cmdline_hist
set history=7
function History_Tests(hist)
" First clear the history
call histadd(a:hist, 'dummy')
call assert_true(histdel(a:hist))
call assert_equal(-1, histnr(a:hist))
call assert_equ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_history.vim", "license": "mit", "size": 10575} |
### File: test/old/testdir/test_hlsearch.vim
" Test for v:hlsearch
source check.vim
source screendump.vim
func Test_hlsearch()
new
call setline(1, repeat(['aaa'], 10))
set hlsearch nolazyredraw
" redraw is needed to make hlsearch highlight the matches
exe "normal! /aaa\<CR>" | redraw
let r1 = screenattr(1... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_hlsearch.vim", "license": "mit", "size": 2778} |
### File: test/old/testdir/test_increment.vim
" Tests for using Ctrl-A/Ctrl-X
func SetUp()
new dummy
set nrformats&vim
set nrformats+=octal
endfunc
func TearDown()
bwipe!
endfunc
" 1) Ctrl-A on visually selected number
" Text:
" foobar-10
" Expected:
" 1) Ctrl-A on start of line:
" foobar-9
" ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_increment.vim", "license": "mit", "size": 24249} |
### File: test/old/testdir/test_indent.vim
" Test for various indent options
func Test_preserveindent()
new
" Test for autoindent copying indent from the previous line
setlocal autoindent
call setline(1, [repeat(' ', 16) .. 'line1'])
call feedkeys("A\nline2", 'xt')
call assert_equal("\t\tline2", getline(2)... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_indent.vim", "license": "mit", "size": 8597} |
### File: test/old/testdir/test_input.vim
" Tests for character input and feedkeys() function.
func Test_feedkeys_x_with_empty_string()
new
call feedkeys("ifoo\<Esc>")
call assert_equal('', getline('.'))
call feedkeys('', 'x')
call assert_equal('foo', getline('.'))
" check it goes back to normal mode imme... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_input.vim", "license": "mit", "size": 1506} |
### File: test/old/testdir/test_ins_complete.vim
" Test for insert completion
source screendump.vim
source check.vim
source vim9.vim
" Test for insert expansion
func Test_ins_complete()
edit test_ins_complete.vim
" The files in the current directory interferes with the files
" used by this test. So use a separa... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_ins_complete.vim", "license": "mit", "size": 83371} |
### File: test/old/testdir/test_ins_complete_no_halt.vim
" Test insert mode completion does not get stuck when looping around.
" In a separate file to avoid the settings to leak to other test cases.
set complete+=kspell
set completeopt+=menu
set completeopt+=menuone
set completeopt+=noselect
set completeopt+=noinsert
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_ins_complete_no_halt.vim", "license": "mit", "size": 1875} |
### File: test/old/testdir/test_interrupt.vim
" Test behavior of interrupt()
let s:bufwritepre_called = 0
let s:bufwritepost_called = 0
func s:bufwritepre()
let s:bufwritepre_called = 1
call interrupt()
endfunction
func s:bufwritepost()
let s:bufwritepost_called = 1
endfunction
func Test_interrupt()
new Xin... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_interrupt.vim", "license": "mit", "size": 671} |
### File: test/old/testdir/test_join.vim
" Test for joining lines.
func Test_join_with_count()
new
call setline(1, ['one', 'two', 'three', 'four'])
normal J
call assert_equal('one two', getline(1))
%del
call setline(1, ['one', 'two', 'three', 'four'])
normal 10J
call assert_equal('one two three four', ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_join.vim", "license": "mit", "size": 10109} |
### File: test/old/testdir/test_jumplist.vim
" Tests for the jumplist functionality
" Tests for the getjumplist() function
func Test_getjumplist()
if !has("jumplist")
return
endif
%bwipe
clearjumps
call assert_equal([[], 0], getjumplist())
call assert_equal([[], 0], getjumplist(1))
call assert_equal... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_jumplist.vim", "license": "mit", "size": 5617} |
### File: test/old/testdir/test_lambda.vim
" Test for lambda and closure
func Test_lambda_feature()
call assert_equal(1, has('lambda'))
endfunc
func Test_lambda_with_filter()
let s:x = 2
call assert_equal([2, 3], filter([1, 2, 3], {i, v -> v >= s:x}))
endfunc
func Test_lambda_with_map()
let s:x = 1
call as... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_lambda.vim", "license": "mit", "size": 7335} |
### File: test/old/testdir/test_langmap.vim
" tests for 'langmap'
source check.vim
CheckFeature langmap
func Test_langmap()
new
set langmap=}l,^x,%v
call setline(1, ['abc'])
call feedkeys('gg0}^', 'tx')
call assert_equal('ac', getline(1))
" in Replace mode
" need silent! to avoid a delay when entering... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_langmap.vim", "license": "mit", "size": 2263} |
### File: test/old/testdir/test_largefile.vim
" Tests for large files
" This is only executed manually: "TEST_FILE=test_largefile.res make oldtest".
" This is not run as part of "make test".
func Test_largefile()
let fname = 'Xlarge.txt'
call delete(fname)
exe "e" fname
" Make sure that a line break is 1 byte... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_largefile.vim", "license": "mit", "size": 755} |
### File: test/old/testdir/test_let.vim
" Tests for the :let command.
source vim9.vim
func Test_let()
" Test to not autoload when assigning. It causes internal error.
set runtimepath+=./sautest
let Test104#numvar = function('tr')
call assert_equal("function('tr')", string(Test104#numvar))
let foo#tr = fun... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_let.vim", "license": "mit", "size": 20650} |
### File: test/old/testdir/test_lineending.vim
" Tests for saving/loading a file with some lines ending in
" CTRL-M, some not
func Test_lineending()
let l = ["this line ends in a\<CR>",
\ "this one doesn't",
\ "this one does\<CR>",
\ "and the last one doesn't"]
set fileformat=dos
enew!
call... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_lineending.vim", "license": "mit", "size": 438} |
### File: test/old/testdir/test_lispindent.vim
" Tests for 'lispwords' settings being global-local.
" And other lisp indent stuff.
set nocompatible viminfo+=nviminfo
func Test_global_local_lispwords()
setglobal lispwords=foo,bar,baz
setlocal lispwords-=foo | setlocal lispwords+=quux
call assert_equal('foo,bar,... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_lispindent.vim", "license": "mit", "size": 3600} |
### File: test/old/testdir/test_listchars.vim
" 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)
if a:leftcol > 0
let save_wrap = &wrap
set nowrap
call cursor(1, 1)
exe... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_listchars.vim", "license": "mit", "size": 20735} |
### File: test/old/testdir/test_listdict.vim
" Tests for the List and Dict types
scriptencoding utf-8
source vim9.vim
func TearDown()
" Run garbage collection after every test
call test_garbagecollect_now()
endfunc
" Tests for List type
" List creation
func Test_list_create()
" Creating List directly with dif... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_listdict.vim", "license": "mit", "size": 48115} |
### File: test/old/testdir/test_listlbr.vim
" Test for linebreak and list option (non-utf8)
scriptencoding latin1
source check.vim
CheckOption linebreak
CheckFeature conceal
source view_util.vim
source screendump.vim
function s:screen_lines(lnum, width) abort
return ScreenLines(a:lnum, a:width)
endfunction
func ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_listlbr.vim", "license": "mit", "size": 11190} |
### File: test/old/testdir/test_listlbr_utf8.vim
" Test for linebreak and list option in utf-8 mode
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
return Screen... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_listlbr_utf8.vim", "license": "mit", "size": 10886} |
### File: test/old/testdir/test_makeencoding.vim
" Tests for 'makeencoding'.
source shared.vim
source check.vim
CheckFeature quickfix
let s:python = PythonProg()
if s:python == ''
throw 'Skipped: python program missing'
endif
let s:script = 'test_makeencoding.py'
if has('iconv')
let s:message_tbl = {
\ 'u... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_makeencoding.vim", "license": "mit", "size": 2997} |
### File: test/old/testdir/test_map_functions.vim
" 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
func Test_maparg()
new
set cpo-=<
set encoding=utf8
" Test... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_map_functions.vim", "license": "mit", "size": 17721} |
### File: test/old/testdir/test_mapping.vim
" Tests for mappings and abbreviations
source shared.vim
source check.vim
source screendump.vim
source term_util.vim
func Test_abbreviation()
" abbreviation with 0x80 should work
inoreab чкпр vim
call feedkeys("Goчкпр \<Esc>", "xt")
call assert_equal('vim ', getli... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_mapping.vim", "license": "mit", "size": 49263} |
### File: test/old/testdir/test_marks.vim
" Test that a deleted mark is restored after delete-undo-redo-undo.
func Test_Restore_DelMark()
enew!
call append(0, [" textline A", " textline B", " textline C"])
normal! 2gg
set nocp viminfo+=nviminfo
exe "normal! i\<C-G>u\<Esc>"
exe "normal! maddu\<C-R>u"
let ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_marks.vim", "license": "mit", "size": 8118} |
### File: test/old/testdir/test_match.vim
" Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(),
" matchaddpos(), matcharg(), matchdelete(), and setmatches().
source screendump.vim
source check.vim
function Test_match()
highlight MyGroup1 term=bold ctermbg=red guibg=red
highlight MyGroup2 ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_match.vim", "license": "mit", "size": 14677} |
### File: test/old/testdir/test_matchadd_conceal.vim
" Test for matchadd() and conceal feature
source check.vim
CheckFeature conceal
source shared.vim
source term_util.vim
source view_util.vim
func Test_simple_matchadd()
new
1put='# This is a Test'
" 1234567890123456
let expect = '# This is a Te... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_matchadd_conceal.vim", "license": "mit", "size": 14396} |
### File: test/old/testdir/test_matchadd_conceal_utf8.vim
" Test for matchadd() and conceal feature using utf-8.
source check.vim
CheckFeature conceal
func s:screenline(lnum) abort
let line = []
for c in range(1, winwidth(0))
call add(line, nr2char(a:lnum->screenchar(c)))
endfor
return s:trim(join(line, '... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_matchadd_conceal_utf8.vim", "license": "mit", "size": 1042} |
### File: test/old/testdir/test_matchfuzzy.vim
" 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:')
call assert_fails('call matchfuzzy(["abc"], [])', 'E730:')
call assert_fails("... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_matchfuzzy.vim", "license": "mit", "size": 17382} |
### File: test/old/testdir/test_matchparen.vim
" Test for the matchparen plugin
if !has('gui_running') && has('unix')
" set term=ansi
endif
source view_util.vim
source check.vim
source screendump.vim
" Test for scrolling that modifies buffer during visual block
func Test_visual_block_scroll()
CheckScreendump
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_matchparen.vim", "license": "mit", "size": 3060} |
### File: test/old/testdir/test_menu.vim
" Test that the system menu can be loaded.
source check.vim
CheckFeature menu
func Test_load_menu()
try
source $VIMRUNTIME/menu.vim
catch
call assert_report('error while loading menus: ' . v:exception)
endtry
call assert_match('browse confirm w', execute(':menu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_menu.vim", "license": "mit", "size": 22707} |
### File: test/old/testdir/test_messages.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()
let oldmore = &more
try
set nomore
let arr = map(range(10), '"hello" . v:val')
for s in arr
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_messages.vim", "license": "mit", "size": 20895} |
### File: test/old/testdir/test_method.vim
" 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))
eval l->assert_equal(l)
eval l->assert_equal(l, 'wrong')
eval l->assert_notequal([3, 2, 1])
eval l->assert_notequal([3, 2, 1], 'wr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_method.vim", "license": "mit", "size": 6054} |
### File: test/old/testdir/test_mksession_utf8.vim
" Test for :mksession, :mkview and :loadview in utf-8 encoding
set encoding=utf-8
scriptencoding utf-8
source check.vim
CheckFeature mksession
func Test_mksession_utf8()
tabnew
let wrap_save = &wrap
set sessionoptions=buffers splitbelow fileencoding=utf-8
ca... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_mksession_utf8.vim", "license": "mit", "size": 2191} |
### File: test/old/testdir/test_modeline.vim
" 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')
let modeline = &modeline
set modeline
call assert_fails('split Xmodeline', 'E518:')
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_modeline.vim", "license": "mit", "size": 12698} |
### File: test/old/testdir/test_move.vim
" Test the ":move" command.
source check.vim
source screendump.vim
func Test_move()
enew!
call append(0, ['line 1', 'line 2', 'line 3'])
g /^$/ delete _
set nomodified
move .
call assert_equal(['line 1', 'line 2', 'line 3'], getline(1, 3))
call assert_false(&mod... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_move.vim", "license": "mit", "size": 1795} |
### File: test/old/testdir/test_nested_function.vim
" Tests for nested functions
source check.vim
func NestedFunc()
func! Func1()
let g:text .= 'Func1 '
endfunc
call Func1()
func! s:func2()
let g:text .= 's:func2 '
endfunc
call s:func2()
func! s:_func3()
let g:text .= 's:_func3 '
endfunc
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_nested_function.vim", "license": "mit", "size": 1344} |
### File: test/old/testdir/test_normal.vim
" Test for various Normal mode commands
source shared.vim
source check.vim
source view_util.vim
source vim9.vim
source screendump.vim
func Setup_NewWindow()
10new
call setline(1, range(1,100))
endfunc
func MyFormatExpr()
" Adds '->$' at lines having numbers followed b... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_normal.vim", "license": "mit", "size": 114792} |
### File: test/old/testdir/test_number.vim
" Test for 'number' and 'relativenumber'
source check.vim
source view_util.vim
source screendump.vim
func s:screen_lines(start, end) abort
return ScreenLines([a:start, a:end], 8)
endfunc
func s:compare_lines(expect, actual)
call assert_equal(a:expect, a:actual)
endfunc... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_number.vim", "license": "mit", "size": 9104} |
### File: test/old/testdir/test_options.vim
" Test for options
source check.vim
source view_util.vim
func Test_whichwrap()
set whichwrap=b,s
call assert_equal('b,s', &whichwrap)
set whichwrap+=h,l
call assert_equal('b,s,h,l', &whichwrap)
set whichwrap+=h,l
call assert_equal('b,s,h,l', &whichwrap)
set... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_options.vim", "license": "mit", "size": 75372} |
### File: test/old/testdir/test_packadd.vim
" Tests for 'packpath' and :packadd
func SetUp()
let s:topdir = getcwd() . '/Xdir'
exe 'set packpath=' . s:topdir
let s:plugdir = s:topdir . '/pack/mine/opt/mytest'
endfunc
func TearDown()
call delete(s:topdir, 'rf')
endfunc
func Test_packadd()
if !exists('s:plu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_packadd.vim", "license": "mit", "size": 18122} |
### File: test/old/testdir/test_partial.vim
" Test binding arguments to a Funcref.
func MyFunc(arg1, arg2, arg3)
return a:arg1 . '/' . a:arg2 . '/' . a:arg3
endfunc
func MySort(up, one, two)
if a:one == a:two
return 0
endif
if a:up
return a:one > a:two ? 1 : -1
endif
return a:one < a:two ? 1 : -1
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_partial.vim", "license": "mit", "size": 11839} |
### File: test/old/testdir/test_paste.vim
" Test for restoring option values when 'paste' is disabled
func Test_paste_opt_restore()
set autoindent expandtab ruler showmatch
if has('rightleft')
" set hkmap
set revins
endif
set smarttab softtabstop=3 textwidth=27 wrapmargin=12
if has('vartabs')
set... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_paste.vim", "license": "mit", "size": 1549} |
### File: test/old/testdir/test_perl.vim
" Tests for Perl interface
source check.vim
CheckFeature perl
CheckNotMSWindows
" FIXME: RunTest don't see any error when Perl abort...
perl $SIG{__WARN__} = sub { die "Unexpected warnings from perl: @_" };
func Test_change_buffer()
call setline(line('$'), ['1 line 1'])
p... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_perl.vim", "license": "mit", "size": 8266} |
### File: test/old/testdir/test_plus_arg_edit.vim
" Tests for complicated + argument to :edit command
function Test_edit()
call writefile(["foo|bar"], "Xfile1")
call writefile(["foo/bar"], "Xfile2")
edit +1|s/|/PIPE/|w Xfile1| e Xfile2|1 | s/\//SLASH/|w
call assert_equal(["fooPIPEbar"], readfile("Xfile1"))
ca... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_plus_arg_edit.vim", "license": "mit", "size": 1321} |
### File: test/old/testdir/test_popup.vim
" 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 = ''
func ListMonths()
if g:setting !... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_popup.vim", "license": "mit", "size": 44007} |
### File: test/old/testdir/test_preview.vim
" Tests for the preview window
source check.vim
CheckFeature quickfix
func Test_Psearch()
" this used to cause ml_get errors
help
let wincount = winnr('$')
0f
ps.
call assert_equal(wincount + 1, winnr('$'))
pclose
call assert_equal(wincount, winnr('$'))
bw... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_preview.vim", "license": "mit", "size": 1225} |
### File: test/old/testdir/test_profile.vim
" Test Vim profiler
source check.vim
CheckFeature profile
source shared.vim
source screendump.vim
func Test_profile_func()
let lines =<< trim [CODE]
profile start Xprofile_func.log
profile func Foo*
func! Foo1()
endfunc
func! Foo2()
let l:count ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_profile.vim", "license": "mit", "size": 24819} |
### File: test/old/testdir/test_prompt_buffer.vim
" Tests for setting 'buftype' to "prompt"
source check.vim
" Nvim's channel implementation differs from Vim's
" CheckFeature channel
source shared.vim
source screendump.vim
func CanTestPromptBuffer()
" We need to use a terminal window to be able to feed keys withou... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_prompt_buffer.vim", "license": "mit", "size": 10693} |
### File: test/old/testdir/test_put.vim
" Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc.
source check.vim
source screendump.vim
func Test_put_block()
new
call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x')
call feedkeys("\<C-V>y", 'x')
call feedkeys("gg0p", 'x')
call assert_equal("\u2500x", getl... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_put.vim", "license": "mit", "size": 7779} |
### File: test/old/testdir/test_python3.vim
" Test for python 3 commands.
" TODO: move tests from test87.in here.
source check.vim
CheckFeature python3
func Test_py3do()
" Check deleting lines does not trigger an ml_get error.
py3 import vim
new
call setline(1, ['one', 'two', 'three'])
py3do vim.command("%d... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_python3.vim", "license": "mit", "size": 7604} |
### File: test/old/testdir/test_pyx3.vim
" Test for pyx* commands and functions with Python 3.
set pyx=3
source check.vim
CheckFeature python3
let s:py2pattern = '^2\.[0-7]\.\d\+'
let s:py3pattern = '^3\.\d\+\.\d\+'
func Test_has_pythonx()
call assert_true(has('pythonx'))
endfunc
func Test_pyx()
redir => var
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_pyx3.vim", "license": "mit", "size": 1930} |
### File: test/old/testdir/test_quickfix.vim
" Test for the quickfix feature.
source check.vim
source vim9.vim
CheckFeature quickfix
source screendump.vim
set encoding=utf-8
func s:setup_commands(cchar)
if a:cchar == 'c'
command! -nargs=* -bang Xlist <mods>clist<bang> <args>
command! -nargs=* Xgetexpr <mo... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_quickfix.vim", "license": "mit", "size": 187806} |
### File: test/old/testdir/test_quotestar.vim
" *-register (quotestar) tests
source shared.vim
source check.vim
CheckFeature clipboard_working
func Do_test_quotestar_for_macunix()
if empty(exepath('pbcopy')) || empty(exepath('pbpaste'))
return 'Test requires pbcopy(1) and pbpaste(1)'
endif
let @* = ''
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_quotestar.vim", "license": "mit", "size": 4684} |
### File: test/old/testdir/test_random.vim
" 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)
call assert_equal(4284103975, rand(r))
call assert_equal(1001954530, rand(r))
call asse... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_random.vim", "license": "mit", "size": 1602} |
### File: test/old/testdir/test_recover.vim
" Test :recover
source check.vim
func Test_recover_root_dir()
" This used to access invalid memory.
split Xtest
set dir=/
call assert_fails('recover', 'E305:')
close!
if has('win32')
" can write in / directory on MS-Windows
let &directory = 'F:\\'
els... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_recover.vim", "license": "mit", "size": 13292} |
### File: test/old/testdir/test_registers.vim
" 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:')
call assert_fails('normal @%', 'E354:')
call asser... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_registers.vim", "license": "mit", "size": 26459} |
### File: test/old/testdir/test_reltime.vim
" Tests for reltime()
source check.vim
CheckFeature reltime
CheckFeature float
func Test_reltime()
let g:test_is_flaky = 1
let now = reltime()
sleep 10m
let later = reltime()
let elapsed = now->reltime()
call assert_true(reltimestr(elapsed) =~ '0\.0')
call ass... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_reltime.vim", "license": "mit", "size": 907} |
### File: test/old/testdir/test_rename.vim
" Test rename()
source shared.vim
func Test_rename_file_to_file()
call writefile(['foo'], 'Xrename1')
call assert_equal(0, rename('Xrename1', 'Xrename2'))
call assert_equal('', glob('Xrename1'))
call assert_equal(['foo'], readfile('Xrename2'))
" When the destina... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_rename.vim", "license": "mit", "size": 3623} |
### File: test/old/testdir/test_retab.vim
" Test :retab
source check.vim
func SetUp()
new
call setline(1, "\ta \t b c ")
endfunc
func TearDown()
bwipe!
endfunc
func Retab(bang, n)
let l:old_tabstop = &tabstop
let l:old_line = getline(1)
exe "retab" . a:bang . a:n
let l:line = getline(1)
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_retab.vim", "license": "mit", "size": 3988} |
### File: test/old/testdir/test_ruby.vim
" Tests for ruby interface
source check.vim
CheckFeature ruby
func Test_ruby_change_buffer()
call setline(line('$'), ['1 line 1'])
ruby Vim.command("normal /^1\n")
ruby $curbuf.line = "1 changed line 1"
call assert_equal('1 changed line 1', getline('$'))
endfunc
func ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_ruby.vim", "license": "mit", "size": 13103} |
### File: test/old/testdir/test_scriptnames.vim
" Test for the :scriptnames command
func Test_scriptnames()
call writefile(['let did_load_script = 123'], 'Xscripting', 'D')
source Xscripting
call assert_equal(123, g:did_load_script)
let scripts = split(execute('scriptnames'), "\n")
let last = scripts[-1]
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_scriptnames.vim", "license": "mit", "size": 3532} |
### File: test/old/testdir/test_scroll_opt.vim
" Test for 'scroll', 'scrolloff', 'smoothscroll', etc.
source check.vim
source screendump.vim
source mouse.vim
func Test_reset_scroll()
let scr = &l:scroll
setlocal scroll=1
setlocal scroll&
call assert_equal(scr, &l:scroll)
setlocal scroll=1
setlocal scrol... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_scroll_opt.vim", "license": "mit", "size": 36306} |
### File: test/old/testdir/test_scrollbind.vim
" Test for 'scrollbind' causing an unexpected scroll of one of the windows.
func Test_scrollbind()
" We don't want the status line to cause problems:
set laststatus=0
let totalLines = &lines * 20
let middle = totalLines / 2
new | only
for i in range(1, totalLin... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_scrollbind.vim", "license": "mit", "size": 7839} |
### File: test/old/testdir/test_search.vim
" Test for the search command
source shared.vim
source screendump.vim
source check.vim
" See test/functional/legacy/search_spec.lua
func Test_search_cmdline()
CheckFunction test_override
CheckOption incsearch
" need to disable char_avail,
" so that expansion of comm... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_search.vim", "license": "mit", "size": 63615} |
### File: test/old/testdir/test_search_stat.vim
" Tests for search_stats, when "S" is not in 'shortmess'
source check.vim
source screendump.vim
func Test_search_stat()
new
set shortmess-=S
" Append 50 lines with text to search for, "foobar" appears 20 times
call append(0, repeat(['foobar', 'foo', 'fooooobar',... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_search_stat.vim", "license": "mit", "size": 14003} |
### File: test/old/testdir/test_searchpos.vim
" Tests for searchpos()
func Test_searchpos()
new one
0put ='1a3'
1put ='123xyz'
call cursor(1, 1)
call assert_equal([1, 1, 2], searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW'))
call cursor(1, 2)
call assert_equal([2, 1, 1], '\%(\([a-z]\)\|\_.\)\{-}xyz'->search... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_searchpos.vim", "license": "mit", "size": 910} |
### File: test/old/testdir/test_selectmode.vim
" Test for Select-mode
source check.vim
" CheckNotGui
" CheckUnix
source shared.vim
source mouse.vim
" Test for select mode
func Test_selectmode_basic()
new
call setline(1, range(1,100))
50
norm! gHy
call assert_equal('y51', getline('.'))
call setline(1, ran... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_selectmode.vim", "license": "mit", "size": 10133} |
### File: test/old/testdir/test_set.vim
" Tests for the :set command
function Test_set_backslash()
let isk_save = &isk
set isk=a,b,c
set isk+=d
call assert_equal('a,b,c,d', &isk)
set isk+=\\,e
call assert_equal('a,b,c,d,\,e', &isk)
set isk-=e
call assert_equal('a,b,c,d,\', &isk)
set isk-=\\
call a... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_set.vim", "license": "mit", "size": 1093} |
### File: test/old/testdir/test_sha256.vim
" Tests for the sha256() function.
source check.vim
CheckFeature cryptv
CheckFunction sha256
function Test_sha256()
" test for empty string:
call assert_equal('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', sha256(""))
"'test for 1 char:
call ass... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_sha256.vim", "license": "mit", "size": 807} |
### File: test/old/testdir/test_shell.vim
" 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.
let g... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_shell.vim", "license": "mit", "size": 9805} |
### File: test/old/testdir/test_shift.vim
" Test shifting lines with :> and :<
source check.vim
func Test_ex_shift_right()
set shiftwidth=2
" shift right current line.
call setline(1, range(1, 5))
2
>
3
>>
call assert_equal(['1',
\ ' 2',
\ ' 3',
\ ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_shift.vim", "license": "mit", "size": 2479} |
### File: test/old/testdir/test_signals.vim
" 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')
return signals =~# '\<' .. a:signal .. '\>'
endfunc
" Test signal WI... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_signals.vim", "license": "mit", "size": 6568} |
### File: test/old/testdir/test_signs.vim
" Test for signs
source check.vim
CheckFeature signs
source screendump.vim
func Test_sign()
new
call setline(1, ['a', 'b', 'c', 'd'])
" Define some signs.
" We can specify icons even if not all versions of vim support icons as
" icon is ignored when not supported.... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_signs.vim", "license": "mit", "size": 78549} |
### File: test/old/testdir/test_sleep.vim
" Test for sleep and sleep! commands
func! s:get_time_ms()
let timestr = reltimestr(reltime())
let dotidx = stridx(timestr, '.')
let sec = str2nr(timestr[:dotidx])
let msec = str2nr(timestr[dotidx + 1:])
return (sec * 1000) + (msec / 1000)
endfunc
func! s:assert_tak... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_sleep.vim", "license": "mit", "size": 773} |
### File: test/old/testdir/test_smartindent.vim
" Tests for smartindent
" Tests for not doing smart indenting when it isn't set.
func Test_nosmartindent()
new
call append(0, [" some test text",
\ " test text",
\ "test text",
\ " test text"])
set nocindent nosmartindent autoindent
exe "normal! gg/some\<CR... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_smartindent.vim", "license": "mit", "size": 3703} |
### File: test/old/testdir/test_sort.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
endfunc
func Compare2(a, b) abort
return a:a - a:b
endfunc
func Test_sort_strings()
" numbers compared as ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_sort.vim", "license": "mit", "size": 24806} |
### File: test/old/testdir/test_source.vim
" Tests for the :source command.
source check.vim
source view_util.vim
func Test_source_autocmd()
call writefile([
\ 'let did_source = 1',
\ ], 'Xsourced')
au SourcePre *source* let did_source_pre = 1
au SourcePost *source* let did_source_post = 1
source Xsourced
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_source.vim", "license": "mit", "size": 3123} |
### File: test/old/testdir/test_source_utf8.vim
" Test the :source! command
source check.vim
func Test_source_utf8()
" check that sourcing a script with 0x80 as second byte works
new
call setline(1, [':%s/àx/--à1234--/g', ':%s/Àx/--À1234--/g'])
write! Xscript
bwipe!
new
call setline(1, [' àx ', ' Àx '])
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_source_utf8.vim", "license": "mit", "size": 1551} |
### File: test/old/testdir/test_spell_utf8.vim
" Test for spell checking with 'encoding' set to utf-8
source check.vim
CheckFeature spell
scriptencoding utf-8
func TearDown()
set nospell
call delete('Xtest.aff')
call delete('Xtest.dic')
call delete('Xtest.utf-8.add')
call delete('Xtest.utf-8.add.spl')
ca... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_spell_utf8.vim", "license": "mit", "size": 25941} |
### File: test/old/testdir/test_spellfile.vim
" Test for commands that operate on the spellfile.
source shared.vim
source check.vim
CheckFeature spell
CheckFeature syntax
func Test_spell_normal()
new
call append(0, ['1 good', '2 goood', '3 goood'])
set spell spellfile=./Xspellfile.add spelllang=en
let oldlan... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_spellfile.vim", "license": "mit", "size": 39838} |
### File: test/old/testdir/test_spellrare.vim
" Test spell checking
source check.vim
CheckFeature spell
" Test spellbadword() with argument, specifically to move to "rare" words
" in normal mode.
func Test_spellrareword()
set spell
" Create a small word list to test that spellbadword('...')
" can return ['...'... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_spellrare.vim", "license": "mit", "size": 1441} |
### File: test/old/testdir/test_startup.vim
" 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()
throw 'skipped: Nvim does not need defaults.vim'
set compatible
source $VIMRUNTIME/defaults.vim
cal... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_startup.vim", "license": "mit", "size": 40822} |
### File: test/old/testdir/test_startup_utf8.vim
" Tests for startup using utf-8.
source check.vim
source shared.vim
source screendump.vim
func Test_read_stdin_utf8()
let linesin = ['テスト', '€ÀÈÌÒÙ']
call writefile(linesin, 'Xtestin', 'D')
let before = [
\ 'set enc=utf-8',
\ 'set fencs=cp932,utf-8',
\ ]
let... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_startup_utf8.vim", "license": "mit", "size": 1892} |
### File: test/old/testdir/test_stat.vim
" Tests for stat functions and checktime
source check.vim
func CheckFileTime(doSleep)
let fnames = ['Xtest1.tmp', 'Xtest2.tmp', 'Xtest3.tmp']
let times = []
let result = 0
" Use three files instead of localtim(), with a network filesystem the file
" times may differ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_stat.vim", "license": "mit", "size": 5580} |
### File: test/old/testdir/test_statusline.vim
" Test 'statusline'
"
" Not tested yet:
" %N
source view_util.vim
source check.vim
source term_util.vim
func SetUp()
set laststatus=2
endfunc
func TearDown()
set laststatus&
endfunc
func s:get_statusline()
return ScreenLines(&lines - 1, &columns)[0]
endfunc
fu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_statusline.vim", "license": "mit", "size": 18833} |
### File: test/old/testdir/test_substitute.vim
" 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
" run in the file, since it depends on
" that the previous substitution atom
" was not yet set.
"
" recursive ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_substitute.vim", "license": "mit", "size": 45774} |
### File: test/old/testdir/test_suspend.vim
" Test :suspend
source shared.vim
source term_util.vim
func CheckSuspended(buf, fileExists)
call WaitForAssert({-> assert_match('[$#] $', term_getline(a:buf, '.'))})
if a:fileExists
call assert_equal(['foo'], readfile('Xfoo'))
else
" Without 'autowrite', buff... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_suspend.vim", "license": "mit", "size": 1991} |
### File: test/old/testdir/test_swap.vim
" Tests for the swap feature
source check.vim
source shared.vim
source term_util.vim
func s:swapname()
return trim(execute('swapname'))
endfunc
" Tests for 'directory' option.
func Test_swap_directory()
CheckUnix
let content = ['start of testfile',
\ 'line 2 Abc... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Vim Script", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test_swap.vim", "license": "mit", "size": 16256} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.