comparison src/testdir/test_function_lists.vim @ 30552:a7a9e8b9af89 v9.0.0611

patch 9.0.0611: tests delete files with a separate delete() call Commit: https://github.com/vim/vim/commit/70e672580b39eb79607c304803efb954cc11f4e6 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 27 19:34:35 2022 +0100 patch 9.0.0611: tests delete files with a separate delete() call Problem: Tests delete files with a separate delete() call. Solution: Use deferred delete.
author Bram Moolenaar <Bram@vim.org>
date Tue, 27 Sep 2022 20:45:03 +0200
parents b24b2217ff9e
children a52697bcffa6
comparison
equal deleted inserted replaced
30551:b2b10228a466 30552:a7a9e8b9af89
8 " functions" lists are in ASCII order. 8 " functions" lists are in ASCII order.
9 9
10 func Test_function_lists() 10 func Test_function_lists()
11 11
12 " Delete any files left over from an earlier run of this test. 12 " Delete any files left over from an earlier run of this test.
13
14 call delete("Xglobal_functions.diff") 13 call delete("Xglobal_functions.diff")
15 call delete("Xfunctions.diff") 14 call delete("Xfunctions.diff")
16 call delete("Xfunction-list.diff") 15 call delete("Xfunction-list.diff")
17 16
18 " Create a file of the functions in evalfunc.c:global_functions[]. 17 " Create a file of the functions in evalfunc.c:global_functions[].
19
20 enew! 18 enew!
21 read ../evalfunc.c 19 read ../evalfunc.c
22 1,/^static funcentry_T global_functions\[\] =$/d 20 1,/^static funcentry_T global_functions\[\] =$/d
23 call search('^};$') 21 call search('^};$')
24 .,$d 22 .,$d
26 %s/^ {"// 24 %s/^ {"//
27 %s/".*// 25 %s/".*//
28 w! Xglobal_functions 26 w! Xglobal_functions
29 27
30 " Verify that those functions are in ASCII order. 28 " Verify that those functions are in ASCII order.
31
32 sort u 29 sort u
33 w! Xsorted_global_functions 30 w! Xsorted_global_functions
34 let l:unequal = assert_equalfile("Xsorted_global_functions", "Xglobal_functions", 31 let l:unequal = assert_equalfile("Xsorted_global_functions", "Xglobal_functions",
35 \ "global_functions[] not sorted") 32 \ "global_functions[] not sorted")
36 if l:unequal && executable("diff") 33 if l:unequal && executable("diff")
37 call system("diff -u Xsorted_global_functions Xglobal_functions > Xglobal_functions.diff") 34 call system("diff -u Xsorted_global_functions Xglobal_functions > Xglobal_functions.diff")
38 endif 35 endif
39 36
40 " Create a file of the functions in evalfunc.c:global_functions[] that are 37 " Create a file of the functions in evalfunc.c:global_functions[] that are
41 " not obsolete, sorted in ASCII order. 38 " not obsolete, sorted in ASCII order.
42
43 enew! 39 enew!
44 read ../evalfunc.c 40 read ../evalfunc.c
45 1,/^static funcentry_T global_functions\[\] =$/d 41 1,/^static funcentry_T global_functions\[\] =$/d
46 call search('^};$') 42 call search('^};$')
47 .,$d 43 .,$d
51 %s/".*// 47 %s/".*//
52 sort u 48 sort u
53 w! ++ff=unix Xsorted_current_global_functions 49 w! ++ff=unix Xsorted_current_global_functions
54 50
55 " Verify that the ":help functions" list is complete and in ASCII order. 51 " Verify that the ":help functions" list is complete and in ASCII order.
56
57 enew! 52 enew!
58 if filereadable('../../doc/builtin.txt') 53 if filereadable('../../doc/builtin.txt')
59 " unpacked MS-Windows zip archive 54 " unpacked MS-Windows zip archive
60 read ../../doc/builtin.txt 55 read ../../doc/builtin.txt
61 else 56 else
75 if l:unequal && executable("diff") 70 if l:unequal && executable("diff")
76 call system("diff -u Xsorted_current_global_functions Xfunctions > Xfunctions.diff") 71 call system("diff -u Xsorted_current_global_functions Xfunctions > Xfunctions.diff")
77 endif 72 endif
78 73
79 " Verify that the ":help function-list" list is complete. 74 " Verify that the ":help function-list" list is complete.
80
81 enew! 75 enew!
82 if filereadable('../../doc/usr_41.txt') 76 if filereadable('../../doc/usr_41.txt')
83 " unpacked MS-Windows zip archive 77 " unpacked MS-Windows zip archive
84 read ../../doc/usr_41.txt 78 read ../../doc/usr_41.txt
85 else 79 else