aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_makeencoding.vim
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-03-07 04:13:04 +0100
committerGitHub <noreply@github.com>2023-03-07 11:13:04 +0800
commitaf23d173883f47fd02a9a380c719e4428370b484 (patch)
treed5da436c1539905528254225dd8f817f1577fb84 /src/nvim/testdir/test_makeencoding.vim
parentbf4eada2c83f5402fc56370fd22af11029a4a3aa (diff)
downloadrneovim-af23d173883f47fd02a9a380c719e4428370b484.tar.gz
rneovim-af23d173883f47fd02a9a380c719e4428370b484.tar.bz2
rneovim-af23d173883f47fd02a9a380c719e4428370b484.zip
test: move oldtests to test directory (#22536)
The new oldtest directory is in test/old/testdir. The reason for this is that many tests have hardcoded the parent directory name to be 'testdir'.
Diffstat (limited to 'src/nvim/testdir/test_makeencoding.vim')
-rw-r--r--src/nvim/testdir/test_makeencoding.vim125
1 files changed, 0 insertions, 125 deletions
diff --git a/src/nvim/testdir/test_makeencoding.vim b/src/nvim/testdir/test_makeencoding.vim
deleted file mode 100644
index e297bdc228..0000000000
--- a/src/nvim/testdir/test_makeencoding.vim
+++ /dev/null
@@ -1,125 +0,0 @@
-" Tests for 'makeencoding'.
-
-source shared.vim
-
-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 = {
- \ 'utf-8': 'ÀÈÌÒÙ こんにちは 你好',
- \ 'latin1': 'ÀÈÌÒÙ',
- \ 'cp932': 'こんにちは',
- \ 'cp936': '你好',
- \}
-else
- let s:message_tbl = {
- \ 'utf-8': 'ÀÈÌÒÙ こんにちは 你好',
- \ 'latin1': 'ÀÈÌÒÙ',
- \}
-endif
-
-
-" Tests for :cgetfile and :lgetfile.
-func Test_getfile()
- set errorfile=Xerror.txt
- set errorformat=%f(%l)\ :\ %m
-
- " :cgetfile
- for enc in keys(s:message_tbl)
- let &makeencoding = enc
- exec "silent !" . s:python . " " . s:script . " " . enc . " > " . &errorfile
- cgetfile
- copen
- call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")",
- \ getline('.'))
- cclose
- endfor
-
- " :lgetfile
- for enc in keys(s:message_tbl)
- let &makeencoding = enc
- exec "silent !" . s:python . " " . s:script . " " . enc . " > " . &errorfile
- lgetfile
- lopen
- call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")",
- \ getline('.'))
- lclose
- endfor
-
- call delete(&errorfile)
-endfunc
-
-
-" Tests for :grep and :lgrep.
-func Test_grep()
- let &grepprg = s:python
- set grepformat=%f(%l)\ :\ %m
-
- " :grep
- for enc in keys(s:message_tbl)
- let &makeencoding = enc
- exec "silent grep! " . s:script . " " . enc
- copen
- call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")",
- \ getline('.'))
- cclose
- endfor
-
- " :lgrep
- for enc in keys(s:message_tbl)
- let &makeencoding = enc
- exec "silent lgrep! " . s:script . " " . enc
- lopen
- call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")",
- \ getline('.'))
- lclose
- endfor
-endfunc
-
-
-" Tests for :make and :lmake.
-func Test_make()
- let &makeprg = s:python
- set errorformat=%f(%l)\ :\ %m
-
- " :make
- for enc in keys(s:message_tbl)
- let &makeencoding = enc
- exec "silent make! " . s:script . " " . enc
- copen
- call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")",
- \ getline('.'))
- cclose
- endfor
-
- " :lmake
- for enc in keys(s:message_tbl)
- let &makeencoding = enc
- exec "silent lmake! " . s:script . " " . enc
- lopen
- call assert_equal("Xfoobar.c|10| " . s:message_tbl[enc] . " (" . enc . ")",
- \ getline('.'))
- lclose
- endfor
-endfunc
-
-" Test for an error file with a long line that needs an encoding conversion
-func Test_longline_conversion()
- new
- call setline(1, ['Xfile:10:' .. repeat("\xe0", 2000)])
- write ++enc=latin1 Xerr.out
- bw!
- set errorformat&
- set makeencoding=latin1
- cfile Xerr.out
- call assert_equal(repeat("\u00e0", 2000), getqflist()[0].text)
- call delete('Xerr.out')
- set makeencoding&
-endfunc
-
-" vim: shiftwidth=2 sts=2 expandtab