summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-04 15:52:25 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-04 15:52:25 +0200
commit6b0e528368415476bfc3a8414c9c70f9852b1517 (patch)
treef7394b8e9044469b04272dbd2ba4b8fcb4b73f22
parentebacddbc16b2d76bf5dad636d7ee5c529f0e8753 (diff)
downloadvim-git-6b0e528368415476bfc3a8414c9c70f9852b1517.tar.gz
patch 8.2.0898: missing help for a function goes unnoticedv8.2.0898
Problem: Missing help for a function goes unnoticed. Solution: Add a test. (Gary Johnson)
-rw-r--r--src/testdir/Make_all.mak2
-rw-r--r--src/testdir/test_function_lists.vim105
-rw-r--r--src/version.c2
3 files changed, 109 insertions, 0 deletions
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index 7fad24b78..6b151d07c 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -139,6 +139,7 @@ NEW_TESTS = \
test_fnamemodify \
test_fold \
test_functions \
+ test_function_lists \
test_ga \
test_getcwd \
test_getvar \
@@ -374,6 +375,7 @@ NEW_TESTS_RES = \
test_fnameescape.res \
test_fold.res \
test_functions.res \
+ test_function_lists.res \
test_getcwd.res \
test_getvar.res \
test_gf.res \
diff --git a/src/testdir/test_function_lists.vim b/src/testdir/test_function_lists.vim
new file mode 100644
index 000000000..609b9bff3
--- /dev/null
+++ b/src/testdir/test_function_lists.vim
@@ -0,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
diff --git a/src/version.c b/src/version.c
index 4262aab28..ce8bbf14f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 898,
+/**/
897,
/**/
896,