To: vim_dev@googlegroups.com Subject: Patch 8.2.0898 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0898 Problem: Missing help for a function goes unnoticed. Solution: Add a test. (Gary Johnson) Files: src/testdir/test_function_lists.vim, src/testdir/Make_all.mak *** ../vim-8.2.0897/src/testdir/test_function_lists.vim 2020-06-04 15:51:54.223965801 +0200 --- src/testdir/test_function_lists.vim 2020-06-04 15:04:08.357642493 +0200 *************** *** 0 **** --- 1,105 ---- + " Test to verify that the three function lists, + " + " global_functions[] in src/evalfunc.c + " *functions* in runtime/doc/eval.txt + " *function-list* in runtime/doc/usr_41.txt + " + " contain the same functions and that the global_functions and ":help + " functions" lists are in ASCII order. + + func Test_function_lists() + + " Delete any files left over from an earlier run of this test. + + call delete("Xglobal_functions.diff") + call delete("Xfunctions.diff") + call delete("Xfunction-list.diff") + + " Create a file of the functions in evalfunc.c:global_functions[]. + + enew! + read ../evalfunc.c + 1,/^static funcentry_T global_functions\[\] =$/d + call search('^};$') + .,$d + v/^ {/d + %s/^ {"// + %s/".*// + w! Xglobal_functions + + " Verify that those functions are in ASCII order. + + sort u + w! Xsorted_global_functions + let l:unequal = assert_equalfile("Xsorted_global_functions", "Xglobal_functions", + \ "global_functions[] not sorted") + if l:unequal && executable("diff") + call system("diff -u Xsorted_global_functions Xglobal_functions > Xglobal_functions.diff") + endif + + " Create a file of the functions in evalfunc.c:global_functions[] that are + " not obsolete, sorted in ASCII order. + + enew! + read ../evalfunc.c + 1,/^static funcentry_T global_functions\[\] =$/d + call search('^};$') + .,$d + v/^ {/d + g/\/\/ obsolete$/d + %s/^ {"// + %s/".*// + sort u + w! Xsorted_current_global_functions + + " Verify that the ":help functions" list is complete and in ASCII order. + + enew! + read ../../runtime/doc/eval.txt + call search('\*functions\*$') + call search('^USAGE') + 1,.d + call search('\*\K\k*()\*$') + .,$d + v/^\S/d + %s/(.*// + let l:lines = getline(1, '$') + call uniq(l:lines) + call writefile(l:lines, "Xfunctions") + let l:unequal = assert_equalfile("Xsorted_current_global_functions", "Xfunctions", + \ "\":help functions\" not sorted or incomplete") + if l:unequal && executable("diff") + call system("diff -u Xsorted_current_global_functions Xfunctions > Xfunctions.diff") + endif + + " Verify that the ":help function-list" list is complete. + + enew! + read ../../runtime/doc/usr_41.txt + call search('\*function-list\*$') + 1,.d + call search('^==*$') + .,$d + v/^\t\S/d + %s/(.*// + %left + sort u + w! Xfunction-list + let l:unequal = assert_equalfile("Xsorted_current_global_functions", "Xfunction-list", + \ "\":help functions-list\" incomplete") + if l:unequal && executable("diff") + call system("diff -u Xsorted_current_global_functions Xfunction-list > Xfunction-list.diff") + endif + + " Clean up. + + call delete("Xglobal_functions") + call delete("Xsorted_global_functions") + call delete("Xsorted_current_global_functions") + call delete("Xfunctions") + call delete("Xfunction-list") + enew! + + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0897/src/testdir/Make_all.mak 2020-04-29 22:01:18.156649911 +0200 --- src/testdir/Make_all.mak 2020-06-01 21:46:35.290973743 +0200 *************** *** 139,144 **** --- 139,145 ---- test_fnamemodify \ test_fold \ test_functions \ + test_function_lists \ test_ga \ test_getcwd \ test_getvar \ *************** *** 374,379 **** --- 375,381 ---- test_fnameescape.res \ test_fold.res \ test_functions.res \ + test_function_lists.res \ test_getcwd.res \ test_getvar.res \ test_gf.res \ *** ../vim-8.2.0897/src/version.c 2020-06-04 15:21:45.482189580 +0200 --- src/version.c 2020-06-04 15:51:44.136002369 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 898, /**/ -- In war we're tough and able. Quite indefatigable Between our quests We sequin vests And impersonate Clark Gable It's a busy life in Camelot. I have to push the pram a lot. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 ///