To: vim_dev@googlegroups.com Subject: Patch 8.2.0712 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0712 Problem: Various code not fully tested. Solution: Add a few more tests. (Yegappan Lakshmanan, closes #6049) Files: src/testdir/test_functions.vim, src/testdir/test_options.vim, src/testdir/test_system.vim, src/testdir/test_termcodes.vim *** ../vim-8.2.0711/src/testdir/test_functions.vim 2020-04-26 15:59:51.206952132 +0200 --- src/testdir/test_functions.vim 2020-05-07 18:41:55.411679335 +0200 *************** *** 570,575 **** --- 570,581 ---- " 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() *************** *** 641,646 **** --- 647,658 ---- " 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() *************** *** 1160,1165 **** --- 1172,1181 ---- call assert_equal(0, filewritable('doesnotexist')) + call mkdir('Xdir') + call assert_equal(2, filewritable('Xdir')) + call delete('Xdir', 'd') + call delete('Xfilewritable') bw! endfunc *** ../vim-8.2.0711/src/testdir/test_options.vim 2020-04-24 20:56:55.934731134 +0200 --- src/testdir/test_options.vim 2020-05-07 18:41:55.415679323 +0200 *************** *** 269,274 **** --- 269,275 ---- " Expand terminal options. call feedkeys(":set t_A\\\"\", 'tx') call assert_equal('"set t_AB t_AF t_AL', @:) + call assert_fails('call feedkeys(":set =\\", "xt")', 'E474:') " Expand directories. call feedkeys(":set cdpath=./\\\"\", 'tx') *** ../vim-8.2.0711/src/testdir/test_system.vim 2019-10-28 00:33:37.000000000 +0100 --- src/testdir/test_system.vim 2020-05-07 18:41:55.415679323 +0200 *************** *** 143,145 **** --- 143,183 ---- call delete('Xdir with spaces', 'rf') endtry endfunc + + " Test for 'shellxquote' + func Test_Shellxquote() + CheckUnix + + let save_shell = &shell + let save_sxq = &shellxquote + let save_sxe = &shellxescape + + call writefile(['#!/bin/sh', 'echo "Cmd: [$*]" > Xlog'], 'Xtestshell') + call setfperm('Xtestshell', "r-x------") + set shell=./Xtestshell + + set shellxquote=\\" + call feedkeys(":!pwd\\", 'xt') + call assert_equal(['Cmd: [-c "pwd"]'], readfile('Xlog')) + + set shellxquote=( + call feedkeys(":!pwd\\", 'xt') + call assert_equal(['Cmd: [-c (pwd)]'], readfile('Xlog')) + + set shellxquote=\\"( + call feedkeys(":!pwd\\", 'xt') + call assert_equal(['Cmd: [-c "(pwd)"]'], readfile('Xlog')) + + set shellxescape=\"&<<()@^ + set shellxquote=( + call feedkeys(":!pwd\"&<<{}@^\\", 'xt') + call assert_equal(['Cmd: [-c (pwd^"^&^<^<{}^@^^)]'], readfile('Xlog')) + + let &shell = save_shell + let &shellxquote = save_sxq + let &shellxescape = save_sxe + call delete('Xtestshell') + call delete('Xlog') + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0711/src/testdir/test_termcodes.vim 2020-03-23 19:28:40.599056151 +0100 --- src/testdir/test_termcodes.vim 2020-05-07 18:41:55.415679323 +0200 *************** *** 1371,1374 **** --- 1371,1400 ---- set timeoutlen& endfunc + " Test for translation of special key codes (, , etc.) + func Test_Keycode_Tranlsation() + let keycodes = [ + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""], + \ ["", ""]] + for [k1, k2] in keycodes + exe "nnoremap " .. k1 .. " 2wx" + call assert_true(maparg(k1, 'n', 0, 1).lhs == k2) + exe "nunmap " .. k1 + endfor + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0711/src/version.c 2020-05-07 18:37:00.128512594 +0200 --- src/version.c 2020-05-07 18:42:53.135508595 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 712, /**/ -- hundred-and-one symptoms of being an internet addict: 63. You start using smileys in your snail mail. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///