• R/O
  • SSH

vim: 提交

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

修订版aad0d64cc13399eaaca0caaf0c1c79959fa69d4b (tree)
时间2019-12-15 04:45:04
作者Bram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.0008: test72 is old style

Commit: https://github.com/vim/vim/commit/3e2d1c8cd61ca073e680f3b221ce887e05ba39cf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 14 20:35:01 2019 +0100

patch 8.2.0008: test72 is old style
Problem: Test72 is old style.
Solution: Convert to new style test. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5362)

更改概述

差异

diff -r c7942f5de97b -r aad0d64cc133 src/Makefile
--- a/src/Makefile Sat Dec 14 18:45:04 2019 +0100
+++ b/src/Makefile Sat Dec 14 20:45:04 2019 +0100
@@ -2256,7 +2256,7 @@
22562256 test42 test44 test49 \
22572257 test52 test59 \
22582258 test64 test69 \
2259- test70 test72 \
2259+ test70 \
22602260 test86 test87 \
22612261 test95 test99:
22622262 cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
diff -r c7942f5de97b -r aad0d64cc133 src/testdir/Make_all.mak
--- a/src/testdir/Make_all.mak Sat Dec 14 18:45:04 2019 +0100
+++ b/src/testdir/Make_all.mak Sat Dec 14 20:45:04 2019 +0100
@@ -37,9 +37,7 @@
3737
3838 # Tests that run on most systems, but not on VMS
3939 SCRIPTS_MORE4 = \
40- test59.out \
41- test72.out \
42-
40+ test59.out
4341
4442 # Tests specifically for MS-Windows.
4543 SCRIPTS_WIN32 =
diff -r c7942f5de97b -r aad0d64cc133 src/testdir/Make_vms.mms
--- a/src/testdir/Make_vms.mms Sat Dec 14 18:45:04 2019 +0100
+++ b/src/testdir/Make_vms.mms Sat Dec 14 20:45:04 2019 +0100
@@ -76,7 +76,7 @@
7676 SCRIPT = test1.out \
7777 test42.out test44.out test49.out \
7878 test64.out test69.out \
79- test72.out test77a.out \
79+ test77a.out \
8080 test95.out test99.out \
8181 test_eval.out
8282
@@ -85,7 +85,6 @@
8585 # test59: Failed/Hangs - VMS does not support spell files (file names
8686 # with too many dots).
8787 #
88-# test72: bug - Vim hangs at :rename (while rename works well otherwise)
8988 # test78: bug - Vim dies at :recover Xtest
9089 # test89: bug - findfile() does not work on VMS (just in the current directory)
9190 # test102: Just ODS-5 supports space and special chars in the filename.
diff -r c7942f5de97b -r aad0d64cc133 src/testdir/test72.in
--- a/src/testdir/test72.in Sat Dec 14 18:45:04 2019 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
1-Tests for undo file.
2-Since this script is sourced we need to explicitly break changes up in
3-undo-able pieces. Do that by setting 'undolevels'.
4-
5-STARTTEST
6-:so small.vim
7-:set belloff=all
8-:"
9-:" Test 'undofile': first a simple one-line change.
10-:set nocompatible viminfo+=nviminfo visualbell
11-:set ul=100 undofile nomore
12-:e! Xtestfile
13-ggdGithis is one line:set ul=100
14-:s/one/ONE/
15-:set ul=100
16-:w
17-:bwipe!
18-:e Xtestfile
19-u:.w! test.out
20-:"
21-:" Test 'undofile', change in original file fails check
22-:set noundofile
23-:e! Xtestfile
24-:s/line/Line/
25-:w
26-:set undofile
27-:bwipe!
28-:e Xtestfile
29-u:.w >>test.out
30-:"
31-:" Test 'undofile', add 10 lines, delete 6 lines, undo 3
32-:set undofile
33-ggdGione
34-two
35-three
36-four
37-five
38-six
39-seven
40-eight
41-nine
42-ten:set ul=100
43-3Gdd:set ul=100
44-dd:set ul=100
45-dd:set ul=100
46-dd:set ul=100
47-dd:set ul=100
48-dd:set ul=100
49-:w
50-:bwipe!
51-:e Xtestfile
52-uuu:w >>test.out
53-:"
54-:" Test that reading the undofiles when setting undofile works
55-:set noundofile ul=0
56-i
57-u:e! Xtestfile
58-:set undofile ul=100
59-uuuuuu:w >>test.out
60-:" And now with encryption, cryptmethod=zip
61-:e! Xtestfile
62-:set undofile cm=zip
63-ggdGimonday
64-tuesday
65-wednesday
66-thursday
67-friday:set ul=100
68-kkkdd:set ul=100
69-dd:set ul=100
70-dd:set ul=100
71-:X
72-foobar
73-foobar
74-:w!
75-:bwipe!
76-:e Xtestfile
77-foobar
78-:set key=
79-uu:w >>test.out
80-:"
81-:"
82-:" With encryption, cryptmethod=blowfish
83-:e! Xtestfile
84-rubbish
85-:set undofile cm=blowfish ff&
86-ggdGijan
87-feb
88-mar
89-apr
90-jun:set ul=100
91-kk0ifoo :set ul=100
92-dd:set ul=100
93-ibar :set ul=100
94-:X
95-foobar
96-foobar
97-:w!
98-:bwipe!
99-:e Xtestfile
100-foobar
101-:set key=
102-/bar
103-:.w >>test.out
104-u:.w >>test.out
105-u:.w >>test.out
106-u:.w >>test.out
107-:"
108-:" With encryption, cryptmethod=blowfish2
109-:e! Xtestfile
110-rubbish
111-:set undofile cm=blowfish2 ff&
112-ggdGijan
113-feb
114-mar
115-apr
116-jun:set ul=100
117-kk0ifoo :set ul=100
118-dd:set ul=100
119-ibar :set ul=100
120-:X
121-foo2bar
122-foo2bar
123-:w!
124-:bwipe!
125-:e Xtestfile
126-foo2bar
127-:set key=
128-/bar
129-:.w >>test.out
130-u:.w >>test.out
131-u:.w >>test.out
132-u:.w >>test.out
133-:"
134-:" Rename the undo file so that it gets cleaned up.
135-:if has("vms")
136-: call rename("_un_Xtestfile", "Xtestundo")
137-:else
138-: call rename(".Xtestfile.un~", "Xtestundo")
139-:endif
140-:qa!
141-ENDTEST
142-
143-1111 -----
144-2222 -----
145-
146-123456789
diff -r c7942f5de97b -r aad0d64cc133 src/testdir/test72.ok
--- a/src/testdir/test72.ok Sat Dec 14 18:45:04 2019 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
1-this is one line
2-this is ONE Line
3-one
4-two
5-six
6-seven
7-eight
8-nine
9-ten
10-one
11-two
12-three
13-four
14-five
15-six
16-seven
17-eight
18-nine
19-ten
20-monday
21-wednesday
22-thursday
23-friday
24-bar apr
25-apr
26-foo mar
27-mar
28-bar apr
29-apr
30-foo mar
31-mar
diff -r c7942f5de97b -r aad0d64cc133 src/testdir/test_undo.vim
--- a/src/testdir/test_undo.vim Sat Dec 14 18:45:04 2019 +0100
+++ b/src/testdir/test_undo.vim Sat Dec 14 20:45:04 2019 +0100
@@ -469,3 +469,187 @@
469469
470470 set undodir&
471471 endfunc
472+
473+" Tests for the undo file
474+" Explicitly break changes up in undo-able pieces by setting 'undolevels'.
475+func Test_undofile_2()
476+ set undolevels=100 undofile
477+ edit Xtestfile
478+ call append(0, 'this is one line')
479+ call cursor(1, 1)
480+
481+ " first a simple one-line change.
482+ set undolevels=100
483+ s/one/ONE/
484+ set undolevels=100
485+ write
486+ bwipe!
487+ edit Xtestfile
488+ undo
489+ call assert_equal('this is one line', getline(1))
490+
491+ " change in original file fails check
492+ set noundofile
493+ edit! Xtestfile
494+ s/line/Line/
495+ write
496+ set undofile
497+ bwipe!
498+ edit Xtestfile
499+ undo
500+ call assert_equal('this is ONE Line', getline(1))
501+
502+ " add 10 lines, delete 6 lines, undo 3
503+ set undofile
504+ call setbufline(0, 1, ['one', 'two', 'three', 'four', 'five', 'six',
505+ \ 'seven', 'eight', 'nine', 'ten'])
506+ set undolevels=100
507+ normal 3Gdd
508+ set undolevels=100
509+ normal dd
510+ set undolevels=100
511+ normal dd
512+ set undolevels=100
513+ normal dd
514+ set undolevels=100
515+ normal dd
516+ set undolevels=100
517+ normal dd
518+ set undolevels=100
519+ write
520+ bwipe!
521+ edit Xtestfile
522+ normal uuu
523+ call assert_equal(['one', 'two', 'six', 'seven', 'eight', 'nine', 'ten'],
524+ \ getline(1, '$'))
525+
526+ " Test that reading the undofiles when setting undofile works
527+ set noundofile undolevels=0
528+ exe "normal i\n"
529+ undo
530+ edit! Xtestfile
531+ set undofile undolevels=100
532+ normal uuuuuu
533+ call assert_equal(['one', 'two', 'three', 'four', 'five', 'six', 'seven',
534+ \ 'eight', 'nine', 'ten'], getline(1, '$'))
535+
536+ bwipe!
537+ call delete('Xtestfile')
538+ let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~'
539+ call delete(ufile)
540+ set undofile& undolevels&
541+endfunc
542+
543+" Test 'undofile' using a file encrypted with 'zip' crypt method
544+func Test_undofile_cryptmethod_zip()
545+ edit Xtestfile
546+ set undofile cryptmethod=zip
547+ call append(0, ['monday', 'tuesday', 'wednesday', 'thursday', 'friday'])
548+ call cursor(5, 1)
549+
550+ set undolevels=100
551+ normal kkkdd
552+ set undolevels=100
553+ normal dd
554+ set undolevels=100
555+ normal dd
556+ set undolevels=100
557+ " encrypt the file using key 'foobar'
558+ call feedkeys("foobar\nfoobar\n")
559+ X
560+ write!
561+ bwipe!
562+
563+ call feedkeys("foobar\n")
564+ edit Xtestfile
565+ set key=
566+ normal uu
567+ call assert_equal(['monday', 'wednesday', 'thursday', 'friday', ''],
568+ \ getline(1, '$'))
569+
570+ bwipe!
571+ call delete('Xtestfile')
572+ let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~'
573+ call delete(ufile)
574+ set undofile& undolevels& cryptmethod&
575+endfunc
576+
577+" Test 'undofile' using a file encrypted with 'blowfish' crypt method
578+func Test_undofile_cryptmethod_blowfish()
579+ edit Xtestfile
580+ set undofile cryptmethod=blowfish
581+ call append(0, ['jan', 'feb', 'mar', 'apr', 'jun'])
582+ call cursor(5, 1)
583+
584+ set undolevels=100
585+ exe 'normal kk0ifoo '
586+ set undolevels=100
587+ normal dd
588+ set undolevels=100
589+ exe 'normal ibar '
590+ set undolevels=100
591+ " encrypt the file using key 'foobar'
592+ call feedkeys("foobar\nfoobar\n")
593+ X
594+ write!
595+ bwipe!
596+
597+ call feedkeys("foobar\n")
598+ edit Xtestfile
599+ set key=
600+ call search('bar')
601+ call assert_equal('bar apr', getline('.'))
602+ undo
603+ call assert_equal('apr', getline('.'))
604+ undo
605+ call assert_equal('foo mar', getline('.'))
606+ undo
607+ call assert_equal('mar', getline('.'))
608+
609+ bwipe!
610+ call delete('Xtestfile')
611+ let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~'
612+ call delete(ufile)
613+ set undofile& undolevels& cryptmethod&
614+endfunc
615+
616+" Test 'undofile' using a file encrypted with 'blowfish2' crypt method
617+func Test_undofile_cryptmethod_blowfish2()
618+ edit Xtestfile
619+ set undofile cryptmethod=blowfish2
620+ call append(0, ['jan', 'feb', 'mar', 'apr', 'jun'])
621+ call cursor(5, 1)
622+
623+ set undolevels=100
624+ exe 'normal kk0ifoo '
625+ set undolevels=100
626+ normal dd
627+ set undolevels=100
628+ exe 'normal ibar '
629+ set undolevels=100
630+ " encrypt the file using key 'foo2bar'
631+ call feedkeys("foo2bar\nfoo2bar\n")
632+ X
633+ write!
634+ bwipe!
635+
636+ call feedkeys("foo2bar\n")
637+ edit Xtestfile
638+ set key=
639+ call search('bar')
640+ call assert_equal('bar apr', getline('.'))
641+ normal u
642+ call assert_equal('apr', getline('.'))
643+ normal u
644+ call assert_equal('foo mar', getline('.'))
645+ normal u
646+ call assert_equal('mar', getline('.'))
647+
648+ bwipe!
649+ call delete('Xtestfile')
650+ let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~'
651+ call delete(ufile)
652+ set undofile& undolevels& cryptmethod&
653+endfunc
654+
655+" vim: shiftwidth=2 sts=2 expandtab
diff -r c7942f5de97b -r aad0d64cc133 src/version.c
--- a/src/version.c Sat Dec 14 18:45:04 2019 +0100
+++ b/src/version.c Sat Dec 14 20:45:04 2019 +0100
@@ -743,6 +743,8 @@
743743 static int included_patches[] =
744744 { /* Add new patch number below this line */
745745 /**/
746+ 8,
747+/**/
746748 7,
747749 /**/
748750 6,
Show on old repository browser