aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_functions.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-22 12:07:16 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-09-22 12:40:26 +0800
commit5d1cb73e7f17c29fc9e68ba293f63d8f8e71c264 (patch)
tree471778ab8fed9e9387d26f852609783d77ff442c /src/nvim/testdir/test_functions.vim
parent71e70d0c9919f1ab25fe3940b32ce549f49b30e8 (diff)
downloadrneovim-5d1cb73e7f17c29fc9e68ba293f63d8f8e71c264.tar.gz
rneovim-5d1cb73e7f17c29fc9e68ba293f63d8f8e71c264.tar.bz2
rneovim-5d1cb73e7f17c29fc9e68ba293f63d8f8e71c264.zip
vim-patch:8.2.0712: various code not fully tested
Problem: Various code not fully tested. Solution: Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6049) https://github.com/vim/vim/commit/0ff5dedf0f69e56320199db7a2aad46be2a1f9b7 Nvim does not support encoding=latin1 or setting keycodes/termcaps.
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r--src/nvim/testdir/test_functions.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 8555e8c866..7262d2d71a 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -462,6 +462,12 @@ func Test_tolower()
" invalid memory.
call tolower("\xC0\x80\xC0")
call tolower("123\xC0\x80\xC0")
+
+ " Test in latin1 encoding
+ let save_enc = &encoding
+ " set encoding=latin1
+ call assert_equal("abc", tolower("ABC"))
+ let &encoding = save_enc
endfunc
func Test_toupper()
@@ -533,6 +539,12 @@ func Test_toupper()
" invalid memory.
call toupper("\xC0\x80\xC0")
call toupper("123\xC0\x80\xC0")
+
+ " Test in latin1 encoding
+ let save_enc = &encoding
+ " set encoding=latin1
+ call assert_equal("ABC", toupper("abc"))
+ let &encoding = save_enc
endfunc
func Test_tr()
@@ -1096,6 +1108,10 @@ func Test_filewritable()
call assert_equal(0, filewritable('doesnotexist'))
+ call mkdir('Xdir')
+ call assert_equal(2, filewritable('Xdir'))
+ call delete('Xdir', 'd')
+
call delete('Xfilewritable')
bw!
endfunc