text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: test/old/testdir/runnvim.sh
#!/usr/bin/env bash
main() {(
local separator="================================================================================"
local oldesttest=
if test "$1" = "--oldesttest" ; then
shift
oldesttest=1
fi
local root="$1" ; shift
local nvim_prg="$1" ; shift
l... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/runnvim.sh", "license": "mit", "size": 2266} |
### File: test/old/testdir/runnvim.vim
let s:logger = {'d_events': []}
function s:logger.on_stdout(id, data, event)
call add(self.d_events, [a:event, a:data])
endfunction
let s:logger.on_stderr = s:logger.on_stdout
function s:logger.on_exit(id, data, event)
call add(self.d_events, [a:event, ['']])
endfunction
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/runnvim.vim", "license": "mit", "size": 1786} |
### File: test/old/testdir/runtest.vim
" This script is sourced while editing the .vim file with the tests.
" When the script is successful the .res file will be created.
" Errors are appended to the test.log file.
"
" To execute only specific test functions, add a second argument. It will be
" matched against the nam... | {"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/runtest.vim", "license": "mit", "size": 17925} |
### File: test/old/testdir/samples/matchparen.vim
" Vim plugin for showing matching parens
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Oct 20
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Exit quickly when:
" - this plugin was already loaded (or disabled)
" - when 'compatible'... | {"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/samples/matchparen.vim", "license": "mit", "size": 7553} |
### File: test/old/testdir/sautest/autoload/foo.vim
let g:loaded_foo_vim += 1
let foo#bar = {}
func foo#bar.echo()
let g:called_foo_bar_echo += 1
endfunc
func foo#addFoo(head)
return a:head .. 'foo'
endfunc
func foo#()
return 'empty'
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/sautest/autoload/foo.vim", "license": "mit", "size": 200} |
### File: test/old/testdir/sautest/autoload/footest.vim
" Autoload script used by test_listdict.vim, test_exists.vim and test_let.vim
let footest#x = 1
func footest#F()
return 0
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/sautest/autoload/footest.vim", "license": "mit", "size": 132} |
### File: test/old/testdir/sautest/autoload/globone.vim
" used by Test_globpath()
| {"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/sautest/autoload/globone.vim", "license": "mit", "size": 26} |
### File: test/old/testdir/sautest/autoload/globtwo.vim
" used by Test_globpath()
| {"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/sautest/autoload/globtwo.vim", "license": "mit", "size": 26} |
### File: test/old/testdir/sautest/autoload/sourced.vim
let g:loaded_sourced_vim += 1
func sourced#something()
endfunc
call sourced#something()
| {"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/sautest/autoload/sourced.vim", "license": "mit", "size": 88} |
### File: test/old/testdir/screendump.vim
source shared.vim
source term_util.vim
| {"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/screendump.vim", "license": "mit", "size": 39} |
### File: test/old/testdir/script_util.vim
" Functions shared by the tests for Vim Script
" Commands to track the execution path of a script
com! XpathINIT let g:Xpath = ''
com! -nargs=1 -bar Xpath let g:Xpath ..= <args>
com! XloopINIT let g:Xloop = 1
com! -nargs=1 -bar Xloop let g:Xpath ... | {"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/script_util.vim", "license": "mit", "size": 2375} |
### File: test/old/testdir/setup.vim
if exists('s:did_load')
" Align Nvim defaults to Vim.
set backspace=
set commentstring=/*\ %s\ */
set complete=.,w,b,u,t,i
set define=^\\s*#\\s*define
set directory^=.
set display=
set fillchars=vert:\|,foldsep:\|,fold:-
set formatoptions=tcq
set fsync
set incl... | {"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/setup.vim", "license": "mit", "size": 3035} |
### File: test/old/testdir/shared.vim
" Functions shared by several tests.
" Only load this script once.
if exists('*PythonProg')
finish
endif
source view_util.vim
" {Nvim}
" Filepath captured from output may be truncated, like this:
" /home/va...estdir/X-test-tmpdir/nvimxbXN4i/10
" Get last 2 segments, then com... | {"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/shared.vim", "license": "mit", "size": 10545} |
### File: test/old/testdir/suite.sh
fail() {
local test_name="$1"
local message="$2"
: "${message:=Test $test_name failed}"
local full_msg="$test_name :: $message"
echo "Failed: $full_msg"
export FAILED=1
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/suite.sh", "license": "mit", "size": 185} |
### File: test/old/testdir/summarize.vim
set cpo&vim
if 1
" This is executed only with the eval feature
set nocompatible
set viminfo=
func Count(match, type)
if a:type ==# 'executed'
let g:executed += (a:match+0)
elseif a:type ==# 'failed'
let g:failed += a:match+0
elseif a:type ==# 'ski... | {"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/summarize.vim", "license": "mit", "size": 1940} |
### File: test/old/testdir/term_util.vim
" Functions about terminal shared by several tests
" Only load this script once.
if exists('*CanRunVimInTerminal')
finish
endif
func CanRunVimInTerminal()
" Nvim: always false, we use Lua screen-tests instead.
return 0
endfunc
" vim: shiftwidth=2 sts=2 expandtab
| {"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/term_util.vim", "license": "mit", "size": 272} |
### File: test/old/testdir/test.sh
fail() {
local test_name="$1"
local message="$2"
: "${message:=Test $test_name failed}"
local full_msg="$test_name :: $message"
echo "Failed: $full_msg"
export FAILED=1
}
print_core() {
local app="$1"
local core="$2"
if test "$app" = quiet ; then
echo "Found c... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/neovim", "path": "test/old/testdir/test.sh", "license": "mit", "size": 1980} |
### File: test/old/testdir/test_alot.vim
" A series of tests that can run in one Vim invocation.
" This makes testing go faster, since Vim doesn't need to restart.
source test_backup.vim
source test_compiler.vim
source test_ex_equal.vim
source test_ex_undo.vim
source test_ex_z.vim
source test_ex_mode.vim
source test_e... | {"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_alot.vim", "license": "mit", "size": 737} |
### File: test/old/testdir/test_alot_latin.vim
" A series of tests that can run in one Vim invocation.
" This makes testing go faster, since Vim doesn't need to restart.
" These tests use latin1 'encoding'. Setting 'encoding' is in the individual
" files, so that they can be run by themselves.
source test_regexp_lat... | {"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_alot_latin.vim", "license": "mit", "size": 280} |
### File: test/old/testdir/test_alot_utf8.vim
" A series of tests that can run in one Vim invocation.
" This makes testing go faster, since Vim doesn't need to restart.
" These tests use utf8 'encoding'. Setting 'encoding' is already done in
" runtest.vim.
source test_charsearch_utf8.vim
source test_expr_utf8.vim
so... | {"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_alot_utf8.vim", "license": "mit", "size": 442} |
### File: test/old/testdir/test_arabic.vim
" Simplistic testing of Arabic mode.
" 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 li... | {"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_arabic.vim", "license": "mit", "size": 17592} |
### File: test/old/testdir/test_arglist.vim
" Test argument list commands
source check.vim
source shared.vim
source term_util.vim
func Reset_arglist()
args a | %argd
endfunc
func Test_argidx()
args a b c
last
call assert_equal(2, argidx())
%argdelete
call assert_equal(0, argidx())
" doing it again does... | {"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_arglist.vim", "license": "mit", "size": 18659} |
### File: test/old/testdir/test_assert.vim
" 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))
call assert_equal(0, v:false->assert_false())
call assert_equal(1, assert_... | {"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_assert.vim", "license": "mit", "size": 16396} |
### File: test/old/testdir/test_autocmd.vim
" Tests for autocommands
source shared.vim
source check.vim
source term_util.vim
source screendump.vim
source vim9.vim
source load.vim
func s:cleanup_buffers() abort
for bnr in range(1, bufnr('$'))
if bufloaded(bnr) && bufnr('%') != bnr
execute 'bd! ' . bnr
... | {"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_autocmd.vim", "license": "mit", "size": 125321} |
### File: test/old/testdir/test_autoload.vim
" Tests for autoload
set runtimepath=./sautest
func Test_autoload_dict_func()
let g:loaded_foo_vim = 0
let g:called_foo_bar_echo = 0
call g:foo#bar.echo()
call assert_equal(1, g:loaded_foo_vim)
call assert_equal(1, g:called_foo_bar_echo)
eval 'bar'->g:foo#addF... | {"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_autoload.vim", "license": "mit", "size": 577} |
### File: test/old/testdir/test_backspace_opt.vim
" Tests for 'backspace' settings
func Test_backspace_option()
set backspace=
call assert_equal('', &backspace)
set backspace=indent
call assert_equal('indent', &backspace)
set backspace=eol
call assert_equal('eol', &backspace)
set backspace=start
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_backspace_opt.vim", "license": "mit", "size": 4191} |
### File: test/old/testdir/test_backup.vim
" Tests for the backup function
source check.vim
func Test_backup()
set backup backupdir=. backupskip=
new
call setline(1, ['line1', 'line2'])
:f Xbackup.txt
:w! Xbackup.txt
" backup file is only created after
" writing a second time (before overwriting)
:w! ... | {"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_backup.vim", "license": "mit", "size": 2371} |
### File: test/old/testdir/test_blob.vim
" Tests for the Blob types
source check.vim
source vim9.vim
func TearDown()
" Run garbage collection after every test
call test_garbagecollect_now()
endfunc
" Tests for Blob type
" Blob creation from constant
func Test_blob_create()
let lines =<< trim END
VAR 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_blob.vim", "license": "mit", "size": 23411} |
### File: test/old/testdir/test_blockedit.vim
" Test for block inserting
"
func Test_blockinsert_indent()
new
filetype plugin indent on
setlocal sw=2 et ft=vim
call setline(1, ['let a=[', ' ''eins'',', ' ''zwei'',', ' ''drei'']'])
call cursor(2, 3)
exe "norm! \<c-v>2jI\\ \<esc>"
call assert_equal(['le... | {"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_blockedit.vim", "license": "mit", "size": 3917} |
### File: test/old/testdir/test_breakindent.vim
" Test for breakindent
"
" Note: if you get strange failures when adding new tests, it might be that
" 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 chec... | {"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_breakindent.vim", "license": "mit", "size": 31572} |
### File: test/old/testdir/test_buffer.vim
" Tests for Vim buffer
source check.vim
" Test for the :bunload command with an offset
func Test_bunload_with_offset()
%bwipe!
call writefile(['B1'], 'Xb1', 'D')
call writefile(['B2'], 'Xb2', 'D')
call writefile(['B3'], 'Xb3', 'D')
call writefile(['B4'], 'Xb4', '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_buffer.vim", "license": "mit", "size": 15433} |
### File: test/old/testdir/test_bufline.vim
" 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()
new
let b = bufnr('%')
hide
call assert_equal(0, setbufline(b, 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_bufline.vim", "license": "mit", "size": 8497} |
### File: test/old/testdir/test_bufwintabinfo.vim
" Tests for the getbufinfo(), getwininfo() and gettabinfo() functions
source check.vim
func Test_getbufwintabinfo()
CheckFeature quickfix
edit Xtestfile1
edit Xtestfile2
let buflist = getbufinfo()
call assert_equal(2, len(buflist))
call assert_match('Xtest... | {"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_bufwintabinfo.vim", "license": "mit", "size": 5403} |
### File: test/old/testdir/test_cd.vim
" 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:')
endfunc
func Test_cd_up_and_down()
let path = getcwd()
cd ..
call assert_note... | {"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_cd.vim", "license": "mit", "size": 6520} |
### File: test/old/testdir/test_cdo.vim
" Tests for the :cdo, :cfdo, :ldo and :lfdo commands
source check.vim
CheckFeature quickfix
" Create the files used by the tests
func SetUp()
call writefile(["Line1", "Line2", "Line3"], 'Xtestfile1')
call writefile(["Line1", "Line2", "Line3"], 'Xtestfile2')
call writefile... | {"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_cdo.vim", "license": "mit", "size": 5451} |
### File: test/old/testdir/test_changedtick.vim
" Tests for b:changedtick
func Test_changedtick_increments()
new
" New buffer has an empty line, tick starts at 2.
let expected = 2
call assert_equal(expected, b:changedtick)
call assert_equal(expected, b:['changedtick'])
call setline(1, 'hello')
let expect... | {"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_changedtick.vim", "license": "mit", "size": 2568} |
### File: test/old/testdir/test_changelist.vim
" Tests for the changelist functionality
" When splitting a window the changelist position is wrong.
" Test the changelist position after splitting a window.
" Test for the bug fixed by 7.4.386
func Test_changelist()
let save_ul = &ul
enew!
call append('$', ['1', '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_changelist.vim", "license": "mit", "size": 2942} |
### File: test/old/testdir/test_charsearch.vim
" Test for character search commands - t, T, f, F, ; and ,
func Test_charsearch()
enew!
call append(0, ['Xabcdefghijkemnopqretuvwxyz',
\ 'Yabcdefghijkemnopqretuvwxyz',
\ 'Zabcdefghijkemnokqretkvwxyz'])
" check that "fe" and ";" work
1
normal! ylfep... | {"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_charsearch.vim", "license": "mit", "size": 2701} |
### File: test/old/testdir/test_charsearch_utf8.vim
" Tests for related f{char} and t{char} using utf-8.
" Test for t,f,F,T movement commands
func Test_search_cmds()
new!
call setline(1, "・最初から最後まで最強のVimは最高")
1
normal! f最
call assert_equal([0, 1, 4, 0], getpos('.'))
normal! ;
call assert_equal([0, 1, 16,... | {"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_charsearch_utf8.vim", "license": "mit", "size": 781} |
### File: test/old/testdir/test_checkpath.vim
" Tests for the :checkpath command
" Test for 'include' without \zs or \ze
func Test_checkpath1()
call mkdir("Xdir1/dir2", "p")
call writefile(['#include "bar.a"'], 'Xdir1/dir2/foo.a')
call writefile(['#include "baz.a"'], 'Xdir1/dir2/bar.a')
call writefile(['... | {"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_checkpath.vim", "license": "mit", "size": 3362} |
### File: test/old/testdir/test_cindent.vim
" Test for cinoptions and cindent
"
func Test_cino_hash()
" Test that curbuf->b_ind_hash_comment is correctly reset
new
setlocal cindent cinoptions=#1
setlocal cinoptions=
call setline(1, ["#include <iostream>"])
call cursor(1, 1)
norm! o#include
"call feedke... | {"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_cindent.vim", "license": "mit", "size": 70135} |
### File: test/old/testdir/test_cjk_linebreak.vim
scriptencoding utf-8
func Run_cjk_linebreak_after(rigorous)
set textwidth=12
for punct in [
\ '!', '%', ')', ',', ':', ';', '>', '?', ']', '}', '’', '”', '†', '‡',
\ '…', '‰', '‱', '‼', '⁇', '⁈', '⁉', '℃', '℉', '、', '。', '〉', '》',
\ '」', '』'... | {"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_cjk_linebreak.vim", "license": "mit", "size": 2816} |
### File: test/old/testdir/test_clientserver.vim
" Tests for the +clientserver feature.
source check.vim
CheckFeature job
if !has('clientserver')
call assert_fails('call remote_startserver("local")', 'E942:')
endif
CheckFeature clientserver
source shared.vim
func Check_X11_Connection()
if has('x11')
CheckE... | {"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_clientserver.vim", "license": "mit", "size": 7345} |
### File: test/old/testdir/test_close_count.vim
" Tests for :[count]close! command
func Test_close_count()
enew! | only
let wids = [win_getid()]
for i in range(5)
new
call add(wids, win_getid())
endfor
4wincmd w
close!
let ids = []
windo call add(ids, win_getid())
call assert_equal([wids[5]... | {"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_close_count.vim", "license": "mit", "size": 3446} |
### File: test/old/testdir/test_cmdline.vim
" Tests for editing the command line.
source check.vim
source screendump.vim
source view_util.vim
source shared.vim
func SetUp()
func SaveLastScreenLine()
let g:Sline = Screenline(&lines - 1)
return ''
endfunc
cnoremap <expr> <F4> SaveLastScreenLine()
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_cmdline.vim", "license": "mit", "size": 137573} |
### File: test/old/testdir/test_cmdwin.vim
" Tests for editing the command line.
source check.vim
source screendump.vim
func Test_cant_open_cmdwin_in_cmdwin()
try
call feedkeys("q:q::q\<CR>", "x!")
catch
let caught = v:exception
endtry
call assert_match('E1292:', caught)
endfunc
func Test_cmdwin_vir... | {"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_cmdwin.vim", "license": "mit", "size": 5554} |
### File: test/old/testdir/test_codestyle.vim
" Test for checking the source code style.
func s:ReportError(fname, lnum, msg)
if a:lnum > 0
call assert_report(a:fname .. ' line ' .. a:lnum .. ': ' .. a:msg)
endif
endfunc
func Test_test_files()
for fname in glob('*.vim', 0, 1)
let g:ignoreSwapExists = 'e... | {"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_codestyle.vim", "license": "mit", "size": 3069} |
### File: test/old/testdir/test_command_count.vim
" Test for user command counts.
func Test_command_count_0()
let bufnr = bufnr('%')
set hidden
set noswapfile
split DoesNotExistEver
let lastbuf = bufnr('$')
call setline(1, 'asdf')
quit!
command! -range -addr=loaded_buffers RangeLoadedBuffers :let lin... | {"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_command_count.vim", "license": "mit", "size": 4901} |
### File: test/old/testdir/test_comments.vim
" Tests for the various flags in the 'comments' option
" Test for the 'n' flag in 'comments'
func Test_comment_nested()
new
setlocal comments=n:> fo+=ro
exe "normal i> B\nD\<C-C>ggOA\<C-C>joC\<C-C>Go\<BS>>>> F\nH"
exe "normal 5GOE\<C-C>6GoG"
let expected =<< trim ... | {"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_comments.vim", "license": "mit", "size": 6160} |
### File: test/old/testdir/test_comparators.vim
function Test_Comparators()
try
let oldisident=&isident
set isident+=#
call assert_equal(1, 1 is#1)
finally
let &isident=oldisident
endtry
endfunction
| {"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_comparators.vim", "license": "mit", "size": 173} |
### File: test/old/testdir/test_compiler.vim
" Test the :compiler command
source check.vim
source shared.vim
func Test_compiler()
CheckExecutable perl
CheckFeature quickfix
let save_LC_ALL = $LC_ALL
let $LC_ALL= "C"
" %:S does not work properly with 'shellslash' set
let save_shellslash = &shellslash
s... | {"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_compiler.vim", "license": "mit", "size": 2372} |
### File: test/old/testdir/test_conceal.vim
" Tests for 'conceal'.
source check.vim
CheckFeature conceal
source screendump.vim
source view_util.vim
func Test_conceal_two_windows()
CheckScreendump
let code =<< trim [CODE]
let lines = ["one one one one one", "two |hidden| here", "three |hidden| three"]
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_conceal.vim", "license": "mit", "size": 23255} |
### File: test/old/testdir/test_const.vim
" Test for :const
func s:noop()
endfunc
func Test_define_var_with_lock()
const i = 1
const f = 1.1
const s = 'vim'
const F = funcref('s:noop')
const l = [1, 2, 3]
const d = {'foo': 10}
if has('channel')
const j = test_null_job()
co... | {"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_const.vim", "license": "mit", "size": 8466} |
### File: test/old/testdir/test_cpoptions.vim
" 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()
let save_cpo = &cpo
call writefile(['one'], 'XfileCpoA', '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_cpoptions.vim", "license": "mit", "size": 22281} |
### File: test/old/testdir/test_crash.vim
" Some tests, that used to crash Vim
source check.vim
source screendump.vim
CheckScreendump
func Test_crash1()
CheckNotBSD
CheckExecutable dash
" Test 7 fails on Mac ...
CheckNotMac
" The following used to crash Vim
let opts = #{cmd: 'sh'}
let vim = GetVimProg... | {"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_crash.vim", "license": "mit", "size": 5484} |
### File: test/old/testdir/test_cursor_func.vim
" 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(v:_null_list)', 'E474:')
endfunc
func Test_move_cursor()
new
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_cursor_func.vim", "license": "mit", "size": 19177} |
### File: test/old/testdir/test_cursorline.vim
" Test for cursorline and cursorlineopt
source check.vim
source screendump.vim
func s:screen_attr(lnum) abort
return map(range(1, 8), 'screenattr(a:lnum, v:val)')
endfunc
func s:test_windows(h, w) abort
call NewWindow(a:h, a:w)
endfunc
func s:close_windows() abort
... | {"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_cursorline.vim", "license": "mit", "size": 10673} |
### File: test/old/testdir/test_curswant.vim
" Tests for curswant not changing when setting an option
func Test_curswant()
new
call append(0, ['1234567890', '12345'])
normal! ggf8j
call assert_equal(7, winsaveview().curswant)
let &tabstop=&tabstop
call assert_equal(4, winsaveview().curswant)
normal! gg... | {"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_curswant.vim", "license": "mit", "size": 563} |
### File: test/old/testdir/test_debugger.vim
" Tests for the Vim script debug commands
source shared.vim
source screendump.vim
source check.vim
func CheckCWD()
" Check that the longer lines don't wrap due to the length of the script name
" in cwd
let script_len = len( getcwd() .. '/Xtest1.vim' )
let longest_l... | {"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_debugger.vim", "license": "mit", "size": 47207} |
### File: test/old/testdir/test_delete.vim
" Test for delete().
source check.vim
source term_util.vim
source screendump.vim
func Test_file_delete()
split Xfdelfile
call setline(1, ['a', 'b'])
wq
call assert_equal(['a', 'b'], readfile('Xfdelfile'))
call assert_equal(0, delete('Xfdelfile'))
call assert_fail... | {"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_delete.vim", "license": "mit", "size": 4047} |
### File: test/old/testdir/test_diffmode.vim
" Tests for diff mode
source shared.vim
source screendump.vim
source check.vim
source view_util.vim
func Test_diff_fold_sync()
enew!
let g:update_count = 0
au DiffUpdated * let g:update_count += 1
let l = range(50)
call setline(1, l)
diffthis
let winone = 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_diffmode.vim", "license": "mit", "size": 49539} |
### File: test/old/testdir/test_digraph.vim
" Tests for digraphs
source check.vim
CheckFeature digraphs
source term_util.vim
func Put_Dig(chars)
exe "norm! o\<c-k>".a:chars
endfu
func Put_Dig_BS(char1, char2)
exe "norm! o".a:char1."\<bs>".a:char2
endfu
func Test_digraphs()
new
call Put_Dig("00")
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_digraph.vim", "license": "mit", "size": 20516} |
### File: test/old/testdir/test_display.vim
" Test for displaying stuff
" Nvim: `:set term` is not supported.
" if !has('gui_running') && has('unix')
" set term=ansi
" endif
source view_util.vim
source check.vim
source screendump.vim
func Test_display_foldcolumn()
CheckFeature folding
new
vnew
vert resize... | {"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_display.vim", "license": "mit", "size": 14306} |
### File: test/old/testdir/test_edit.vim
" Test for edit functions
if exists("+t_kD")
let &t_kD="[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
func Test_edit_00b... | {"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_edit.vim", "license": "mit", "size": 66144} |
### File: test/old/testdir/test_environ.vim
" Test for environment variables.
scriptencoding utf-8
source check.vim
func Test_environ()
unlet! $TESTENV
call assert_equal(0, has_key(environ(), 'TESTENV'))
let $TESTENV = 'foo'
call assert_equal(1, has_key(environ(), 'TESTENV'))
let $TESTENV = 'こんにちわ'
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_environ.vim", "license": "mit", "size": 2579} |
### File: test/old/testdir/test_erasebackword.vim
func Test_erasebackword()
enew
exe "normal o wwwこんにちわ世界ワールドvim \<C-W>"
call assert_equal(' wwwこんにちわ世界ワールド', getline('.'))
exe "normal o wwwこんにちわ世界ワールドvim \<C-W>\<C-W>"
call assert_equal(' wwwこんにちわ世界', getline('.'))
exe "normal o wwwこんにちわ世界ワールドvim \<C-W>\<C... | {"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_erasebackword.vim", "license": "mit", "size": 840} |
### File: test/old/testdir/test_escaped_glob.vim
" Test whether glob()/globpath() return correct results with certain escaped
" characters.
func SetUp()
" consistent sorting of file names
set nofileignorecase
endfunction
function Test_glob()
if !has('unix')
" This test fails on Windows because of the specia... | {"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_escaped_glob.vim", "license": "mit", "size": 1169} |
### File: test/old/testdir/test_eval_stuff.vim
" Tests for various eval things.
source view_util.vim
source shared.vim
function s:foo() abort
try
return [] == 0
catch
return 1
endtry
endfunction
func Test_catch_return_with_error()
call assert_equal(1, s:foo())
endfunc
func Test_nocatch_restore_silen... | {"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_eval_stuff.vim", "license": "mit", "size": 14982} |
### File: test/old/testdir/test_ex_equal.vim
" Test Ex := command.
func Test_ex_equal()
new
call setline(1, ["foo\tbar", "bar\tfoo"])
let a = execute('=')
call assert_equal("\n2", a)
let a = execute('.=')
call assert_equal("\n1", a)
call assert_fails('3=', 'E16:')
bwipe!
endfunc
func Test_ex_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_ex_equal.vim", "license": "mit", "size": 788} |
### File: test/old/testdir/test_ex_mode.vim
" 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?
call feedkeys("Q"
\ .. "let s:test_ex =<< END\<C... | {"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_ex_mode.vim", "license": "mit", "size": 10031} |
### File: test/old/testdir/test_ex_undo.vim
" Tests for :undo
func Test_ex_undo()
new ex-undo
setlocal ul=10
exe "normal ione\n\<Esc>"
setlocal ul=10
exe "normal itwo\n\<Esc>"
setlocal ul=10
exe "normal ithree\n\<Esc>"
call assert_equal(4, line('$'))
undo
call assert_equal(3, line('$'))
undo 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_ex_undo.vim", "license": "mit", "size": 367} |
### File: test/old/testdir/test_ex_z.vim
" Test :z
func Test_z()
call setline(1, range(1, 100))
let a = execute('20z3')
call assert_equal("\n20\n21\n22", a)
call assert_equal(22, line('.'))
" 'window' should be set to the {count} value.
call assert_equal(3, &window)
" If there is only one window, then ... | {"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_ex_z.vim", "license": "mit", "size": 3133} |
### File: test/old/testdir/test_excmd.vim
" Tests for various Ex commands.
source check.vim
source shared.vim
source term_util.vim
source screendump.vim
func Test_ex_delete()
new
call setline(1, ['a', 'b', 'c'])
2
" :dl is :delete with the "l" flag, not :dlist
.dl
call assert_equal(['a', 'c'], 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_excmd.vim", "license": "mit", "size": 25120} |
### File: test/old/testdir/test_exec_while_if.vim
" Test for :execute, :while, :for and :if
func Test_exec_while_if()
new
let i = 0
while i < 12
let i = i + 1
execute "normal o" . i . "\033"
if i % 2
normal Ax
if i == 9
break
endif
if i == 5
continue
el... | {"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_exec_while_if.vim", "license": "mit", "size": 862} |
### File: test/old/testdir/test_execute_func.vim
" test execute()
source view_util.vim
source check.vim
source vim9.vim
source term_util.vim
func NestedEval()
let nested = execute('echo "nested\nlines"')
echo 'got: "' . nested . '"'
endfunc
func NestedRedir()
redir => var
echo 'broken'
redir END
endfunc
f... | {"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_execute_func.vim", "license": "mit", "size": 6352} |
### File: test/old/testdir/test_exists.vim
" Tests for the exists() function
func Test_exists()
augroup myagroup
autocmd! BufEnter *.my echo "myfile edited"
autocmd! FuncUndefined UndefFun exec "fu UndefFun()\nendfu"
augroup END
set rtp+=./sautest
" valid autocmd group
call assert_equa... | {"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_exists.vim", "license": "mit", "size": 11610} |
### File: test/old/testdir/test_exists_autocmd.vim
" Test that groups and patterns are tested correctly when calling exists() for
" autocommands.
function Test_AutoCommands()
let results=[]
augroup auexists
augroup END
call assert_true(exists("##BufEnter"))
call assert_false(exists("#BufEnter"))
au BufEnte... | {"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_exists_autocmd.vim", "license": "mit", "size": 868} |
### File: test/old/testdir/test_exit.vim
" Tests for exiting Vim.
source shared.vim
source check.vim
func Test_exiting()
let after =<< trim [CODE]
au QuitPre * call writefile(["QuitPre"], "Xtestout")
au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")
quit
[CODE]
if RunVim([], after, '')
... | {"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_exit.vim", "license": "mit", "size": 4035} |
### File: test/old/testdir/test_expand.vim
" Test for expanding file names
source shared.vim
source check.vim
func Test_with_directories()
call mkdir('Xdir1')
call mkdir('Xdir2')
call mkdir('Xdir3')
cd Xdir3
call mkdir('Xdir4')
cd ..
split Xdir1/file
call setline(1, ['a', 'b'])
w
w Xdir3/Xdir4/fi... | {"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_expand.vim", "license": "mit", "size": 6995} |
### File: test/old/testdir/test_expand_func.vim
" Tests for expand()
source shared.vim
let s:sfile = expand('<sfile>')
let s:slnum = str2nr(expand('<slnum>'))
let s:sflnum = str2nr(expand('<sflnum>'))
func s:expand_sfile()
return expand('<sfile>')
endfunc
func s:expand_slnum()
return str2nr(expand('<slnum>'))
e... | {"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_expand_func.vim", "license": "mit", "size": 4263} |
### File: test/old/testdir/test_expr.vim
" Tests for expressions.
source check.vim
source vim9.vim
func Test_equal()
let base = {}
func base.method()
return 1
endfunc
func base.other() dict
return 1
endfunc
let instance = copy(base)
call assert_true(base.method == instance.method)
call assert_... | {"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_expr.vim", "license": "mit", "size": 37562} |
### File: test/old/testdir/test_expr_utf8.vim
" Tests for expressions using utf-8.
func Test_strgetchar()
call assert_equal(char2nr('á'), strgetchar('áxb', 0))
call assert_equal(char2nr('x'), strgetchar('áxb', 1))
call assert_equal(char2nr('a'), strgetchar('àxb', 0))
call assert_equal(char2nr('̀'), strgetcha... | {"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_expr_utf8.vim", "license": "mit", "size": 1765} |
### File: test/old/testdir/test_file_perm.vim
" Test getting and setting file permissions.
func Test_file_perm()
call assert_equal('', getfperm('Xtest'))
call assert_equal(0, 'Xtest'->setfperm('r--------'))
call writefile(['one'], 'Xtest')
call assert_true(len('Xtest'->getfperm()) == 9)
call assert_equal(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_file_perm.vim", "license": "mit", "size": 930} |
### File: test/old/testdir/test_file_size.vim
" Inserts 2 million lines with consecutive integers starting from 1
" (essentially, the output of GNU's seq 1 2000000), writes them to Xtest
" and writes its cksum to test.out.
"
" We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess
" up the lines... | {"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_file_size.vim", "license": "mit", "size": 1636} |
### File: test/old/testdir/test_filechanged.vim
" Tests for when a file was changed outside of Vim.
source check.vim
func Test_FileChangedShell_reload()
CheckUnix
augroup testreload
au FileChangedShell Xchanged_r let g:reason = v:fcs_reason | let v:fcs_choice = 'reload'
augroup END
new Xchanged_r
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_filechanged.vim", "license": "mit", "size": 7675} |
### File: test/old/testdir/test_fileformat.vim
" Test behavior of fileformat after bwipeout of last buffer
func Test_fileformat_after_bw()
bwipeout
set fileformat&
if &fileformat == 'dos'
let test_fileformats = 'unix'
elseif &fileformat == 'unix'
let test_fileformats = 'mac'
else " must be mac
le... | {"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_fileformat.vim", "license": "mit", "size": 8144} |
### File: test/old/testdir/test_filetype.vim
" Test :setfiletype
func Test_backup_strip()
filetype on
let fname = 'Xdetect.js~~~~~~~~~~~'
call writefile(['one', 'two', 'three'], fname, 'D')
exe 'edit ' .. fname
call assert_equal('javascript', &filetype)
bwipe!
filetype off
endfunc
func Test_detection()... | {"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_filetype.vim", "license": "mit", "size": 91137} |
### File: test/old/testdir/test_filter_cmd.vim
" Test the :filter command modifier
source check.vim
func Test_filter()
edit Xdoesnotmatch
edit Xwillmatch
call assert_equal('"Xwillmatch"', substitute(execute('filter willma ls'), '[^"]*\(".*"\)[^"]*', '\1', ''))
bwipe Xdoesnotmatch
bwipe Xwillmatch
new
c... | {"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_filter_cmd.vim", "license": "mit", "size": 5948} |
### File: test/old/testdir/test_filter_map.vim
" Test filter() and map()
source vim9.vim
" list with expression string
func Test_filter_map_list_expr_string()
" filter()
call assert_equal([2, 3, 4], filter([1, 2, 3, 4], 'v:val > 1'))
call assert_equal([3, 4], filter([1, 2, 3, 4], 'v:key > 1'))
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_filter_map.vim", "license": "mit", "size": 15876} |
### File: test/old/testdir/test_find_complete.vim
" Tests for the 'find' command completion.
" Do all the tests in a separate window to avoid E211 when we recursively
" delete the Xfind directory during cleanup
func Test_find_complete()
set belloff=all
" On windows a stale "Xfind" directory may exist, remove it s... | {"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_find_complete.vim", "license": "mit", "size": 5056} |
### File: test/old/testdir/test_findfile.vim
" Test findfile() and finddir()
let s:files = [ 'Xfinddir1/foo',
\ 'Xfinddir1/bar',
\ 'Xfinddir1/Xdir2/foo',
\ 'Xfinddir1/Xdir2/foobar',
\ 'Xfinddir1/Xdir2/Xdir3/bar',
\ 'Xfinddir1/Xdir2/Xdir3/barfoo' ]
... | {"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_findfile.vim", "license": "mit", "size": 10107} |
### File: test/old/testdir/test_fixeol.vim
" Tests for 'fixeol', 'eof' and 'eol'
func Test_fixeol()
" first write two test files – with and without trailing EOL
" use Unix fileformat for consistency
set ff=unix
enew!
call setline('.', 'with eol or eof')
w! XXEol
enew!
set noeof noeol nofixeol
call se... | {"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_fixeol.vim", "license": "mit", "size": 2903} |
### File: test/old/testdir/test_flatten.vim
" Test for flatting list.
func Test_flatten()
call assert_fails('call flatten(1)', 'E686:')
call assert_fails('call flatten({})', 'E686:')
call assert_fails('call flatten("string")', 'E686:')
call assert_fails('call flatten([], [])', 'E745:')
call assert_fails('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_flatten.vim", "license": "mit", "size": 4139} |
### File: test/old/testdir/test_float_func.vim
" test float functions
source check.vim
CheckFeature float
source vim9.vim
func Test_abs()
call assert_equal('1.23', string(abs(1.23)))
call assert_equal('1.23', string(abs(-1.23)))
eval -1.23->abs()->string()->assert_equal('1.23')
call assert_equal('0.0', strin... | {"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_float_func.vim", "license": "mit", "size": 15152} |
### File: test/old/testdir/test_fnameescape.vim
" Test if fnameescape is correct for special chars like !
func Test_fnameescape()
let fname = 'Xspa ce'
let status = v:false
try
exe "w! " . fnameescape(fname)
let status = v:true
endtry
call assert_true(status, "Space")
call delete(fname)
let fnam... | {"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_fnameescape.vim", "license": "mit", "size": 630} |
### File: test/old/testdir/test_fnamemodify.vim
" Test filename modifiers.
func Test_fnamemodify()
let save_home = $HOME
let save_shell = &shell
let save_shellslash = &shellslash
let $HOME = fnamemodify('.', ':p:h:h')
set shell=sh
set shellslash
call assert_equal('/', fnamemodify('.', ':p')[-1:])
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_fnamemodify.vim", "license": "mit", "size": 5159} |
### File: test/old/testdir/test_fold.vim
" Test for folding
source check.vim
source view_util.vim
source screendump.vim
func PrepIndent(arg)
return [a:arg] + repeat(["\t".a:arg], 5)
endfu
func Test_address_fold_new_default_commentstring()
" Test with the new commentstring defaults, that includes padding after v9... | {"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_fold.vim", "license": "mit", "size": 44254} |
### File: test/old/testdir/test_format.vim
" Tests for expressions.
source check.vim
source vim9.vim
func Test_printf_pos_misc()
let lines =<< trim END
call assert_equal('123', printf('%1$d', 123))
call assert_equal('', printf('%1$.0d', 0))
call assert_equal('00005', printf('%1$5.5d', 5))
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_format.vim", "license": "mit", "size": 25309} |
### File: test/old/testdir/test_functions.vim
" Tests for various functions.
source shared.vim
source check.vim
source term_util.vim
source screendump.vim
source vim9.vim
" Must be done first, since the alternate buffer must be unset.
func Test_00_bufexists()
call assert_equal(0, bufexists('does_not_exist'))
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_functions.vim", "license": "mit", "size": 130779} |
### File: test/old/testdir/test_ga.vim
" Test ga normal command, and :ascii Ex command.
func Do_ga(c)
call setline(1, a:c)
let l:a = execute("norm 1goga")
let l:b = execute("ascii")
call assert_equal(l:a, l:b)
return l:a
endfunc
func Test_ga_command()
new
set display=uhex
call assert_equal("\nNUL", ... | {"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_ga.vim", "license": "mit", "size": 1847} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.