]> granicus.if.org Git - vim/commitdiff
patch 8.2.0008: test72 is old style v8.2.0008
authorBram Moolenaar <Bram@vim.org>
Sat, 14 Dec 2019 19:35:01 +0000 (20:35 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 14 Dec 2019 19:35:01 +0000 (20:35 +0100)
Problem:    Test72 is old style.
Solution:   Convert to new style test. (Yegappan Lakshmanan, closes #5362)

src/Makefile
src/testdir/Make_all.mak
src/testdir/Make_vms.mms
src/testdir/test72.in [deleted file]
src/testdir/test72.ok [deleted file]
src/testdir/test_undo.vim
src/version.c

index fc0ffa76f8723b9a4ea9aff3f3b93c1c063710e2..6b1881db3ddcef9dd9845a70bac75aad101caf5e 100644 (file)
@@ -2256,7 +2256,7 @@ test1 \
        test42 test44 test49 \
        test52 test59 \
        test64 test69 \
-       test70 test72 \
+       test70 \
        test86 test87 \
        test95 test99:
        cd testdir; rm -f $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTESTTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
index 665bcc77659398163cdfb5795192e64fc2525393..41f246a2c6b9132a0a20454ccb6bb3f716c688cd 100644 (file)
@@ -37,9 +37,7 @@ SCRIPTS_MORE2 = \
 
 # Tests that run on most systems, but not on VMS
 SCRIPTS_MORE4 = \
-       test59.out \
-       test72.out \
-
+       test59.out
 
 # Tests specifically for MS-Windows.
 SCRIPTS_WIN32 =
index e31060bd918bde127c52bb0c06868c0f0d946e50..0959c45de9b32ba088e82bdb4206272029cbdd19 100644 (file)
@@ -76,7 +76,7 @@ VIMPROG = <->vim.exe
 SCRIPT = test1.out \
        test42.out test44.out test49.out \
        test64.out test69.out \
-       test72.out test77a.out \
+       test77a.out \
        test95.out test99.out \
        test_eval.out
 
@@ -85,7 +85,6 @@ SCRIPT = test1.out \
 # test59: Failed/Hangs - VMS does not support spell files (file names
 # with too many dots).
 #
-# test72: bug - Vim hangs at :rename (while rename works well otherwise)
 # test78: bug - Vim dies at :recover Xtest 
 # test89: bug - findfile() does not work on VMS (just in the current directory) 
 # test102: Just ODS-5 supports space and special chars in the filename.
diff --git a/src/testdir/test72.in b/src/testdir/test72.in
deleted file mode 100644 (file)
index 961df4c..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-Tests for undo file.
-Since this script is sourced we need to explicitly break changes up in
-undo-able pieces.  Do that by setting 'undolevels'.
-
-STARTTEST
-:so small.vim
-:set belloff=all
-:"
-:" Test 'undofile': first a simple one-line change.
-:set nocompatible viminfo+=nviminfo visualbell
-:set ul=100 undofile nomore
-:e! Xtestfile
-ggdGithis is one line\e:set ul=100
-:s/one/ONE/
-:set ul=100
-:w
-:bwipe!
-:e Xtestfile
-u:.w! test.out
-:"
-:" Test 'undofile', change in original file fails check
-:set noundofile
-:e! Xtestfile
-:s/line/Line/
-:w
-:set undofile
-:bwipe!
-:e Xtestfile
-u:.w >>test.out
-:"
-:" Test 'undofile', add 10 lines, delete 6 lines, undo 3
-:set undofile
-ggdGione
-two
-three
-four
-five
-six
-seven
-eight
-nine
-ten\e:set ul=100
-3Gdd:set ul=100
-dd:set ul=100
-dd:set ul=100
-dd:set ul=100
-dd:set ul=100
-dd:set ul=100
-:w
-:bwipe!
-:e Xtestfile
-uuu:w >>test.out
-:"
-:" Test that reading the undofiles when setting undofile works
-:set noundofile ul=0
-i
-\eu:e! Xtestfile
-:set undofile ul=100
-uuuuuu:w >>test.out
-:" And now with encryption, cryptmethod=zip
-:e! Xtestfile
-:set undofile cm=zip
-ggdGimonday
-tuesday
-wednesday
-thursday
-friday\e:set ul=100
-kkkdd:set ul=100
-dd:set ul=100
-dd:set ul=100
-:X
-foobar
-foobar
-:w!
-:bwipe!
-:e Xtestfile
-foobar
-:set key=
-uu:w >>test.out
-:"
-:"
-:" With encryption, cryptmethod=blowfish
-:e! Xtestfile
-rubbish
-:set undofile cm=blowfish ff&
-ggdGijan
-feb
-mar
-apr
-jun\e:set ul=100
-kk0ifoo \e:set ul=100
-dd:set ul=100
-ibar \e:set ul=100
-:X
-foobar
-foobar
-:w!
-:bwipe!
-:e Xtestfile
-foobar
-:set key=
-/bar
-:.w >>test.out
-u:.w >>test.out
-u:.w >>test.out
-u:.w >>test.out
-:"
-:" With encryption, cryptmethod=blowfish2
-:e! Xtestfile
-rubbish
-:set undofile cm=blowfish2 ff&
-ggdGijan
-feb
-mar
-apr
-jun\e:set ul=100
-kk0ifoo \e:set ul=100
-dd:set ul=100
-ibar \e:set ul=100
-:X
-foo2bar
-foo2bar
-:w!
-:bwipe!
-:e Xtestfile
-foo2bar
-:set key=
-/bar
-:.w >>test.out
-u:.w >>test.out
-u:.w >>test.out
-u:.w >>test.out
-:"
-:" Rename the undo file so that it gets cleaned up.
-:if has("vms")
-: call rename("_un_Xtestfile", "Xtestundo")
-:else
-: call rename(".Xtestfile.un~", "Xtestundo")
-:endif
-:qa!
-ENDTEST
-
-1111 -----
-2222 -----
-
-123456789
diff --git a/src/testdir/test72.ok b/src/testdir/test72.ok
deleted file mode 100644 (file)
index 8d30ba1..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-this is one line
-this is ONE Line
-one
-two
-six
-seven
-eight
-nine
-ten
-one
-two
-three
-four
-five
-six
-seven
-eight
-nine
-ten
-monday
-wednesday
-thursday
-friday
-bar apr
-apr
-foo mar
-mar
-bar apr
-apr
-foo mar
-mar
index 12d835b48e68a95fa0de8342fd70fe11c59e2519..a76073e17d13ae98cf812b97b27788cec34ff761 100644 (file)
@@ -469,3 +469,187 @@ funct Test_undofile()
 
   set undodir&
 endfunc
+
+" Tests for the undo file
+" Explicitly break changes up in undo-able pieces by setting 'undolevels'.
+func Test_undofile_2()
+  set undolevels=100 undofile
+  edit Xtestfile
+  call append(0, 'this is one line')
+  call cursor(1, 1)
+
+  " first a simple one-line change.
+  set undolevels=100
+  s/one/ONE/
+  set undolevels=100
+  write
+  bwipe!
+  edit Xtestfile
+  undo
+  call assert_equal('this is one line', getline(1))
+
+  " change in original file fails check
+  set noundofile
+  edit! Xtestfile
+  s/line/Line/
+  write
+  set undofile
+  bwipe!
+  edit Xtestfile
+  undo
+  call assert_equal('this is ONE Line', getline(1))
+
+  " add 10 lines, delete 6 lines, undo 3
+  set undofile
+  call setbufline(0, 1, ['one', 'two', 'three', 'four', 'five', 'six',
+             \ 'seven', 'eight', 'nine', 'ten'])
+  set undolevels=100
+  normal 3Gdd
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  write
+  bwipe!
+  edit Xtestfile
+  normal uuu
+  call assert_equal(['one', 'two', 'six', 'seven', 'eight', 'nine', 'ten'],
+             \ getline(1, '$'))
+
+  " Test that reading the undofiles when setting undofile works
+  set noundofile undolevels=0
+  exe "normal i\n"
+  undo
+  edit! Xtestfile
+  set undofile undolevels=100
+  normal uuuuuu
+  call assert_equal(['one', 'two', 'three', 'four', 'five', 'six', 'seven',
+             \ 'eight', 'nine', 'ten'], getline(1, '$'))
+
+  bwipe!
+  call delete('Xtestfile')
+  let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~'
+  call delete(ufile)
+  set undofile& undolevels&
+endfunc
+
+" Test 'undofile' using a file encrypted with 'zip' crypt method
+func Test_undofile_cryptmethod_zip()
+  edit Xtestfile
+  set undofile cryptmethod=zip
+  call append(0, ['monday', 'tuesday', 'wednesday', 'thursday', 'friday'])
+  call cursor(5, 1)
+
+  set undolevels=100
+  normal kkkdd
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  " encrypt the file using key 'foobar'
+  call feedkeys("foobar\nfoobar\n")
+  X
+  write!
+  bwipe!
+
+  call feedkeys("foobar\n")
+  edit Xtestfile
+  set key=
+  normal uu
+  call assert_equal(['monday', 'wednesday', 'thursday', 'friday', ''],
+                    \ getline(1, '$'))
+
+  bwipe!
+  call delete('Xtestfile')
+  let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~'
+  call delete(ufile)
+  set undofile& undolevels& cryptmethod&
+endfunc
+
+" Test 'undofile' using a file encrypted with 'blowfish' crypt method
+func Test_undofile_cryptmethod_blowfish()
+  edit Xtestfile
+  set undofile cryptmethod=blowfish
+  call append(0, ['jan', 'feb', 'mar', 'apr', 'jun'])
+  call cursor(5, 1)
+
+  set undolevels=100
+  exe 'normal kk0ifoo '
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  exe 'normal ibar '
+  set undolevels=100
+  " encrypt the file using key 'foobar'
+  call feedkeys("foobar\nfoobar\n")
+  X
+  write!
+  bwipe!
+
+  call feedkeys("foobar\n")
+  edit Xtestfile
+  set key=
+  call search('bar')
+  call assert_equal('bar apr', getline('.'))
+  undo
+  call assert_equal('apr', getline('.'))
+  undo
+  call assert_equal('foo mar', getline('.'))
+  undo
+  call assert_equal('mar', getline('.'))
+
+  bwipe!
+  call delete('Xtestfile')
+  let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~'
+  call delete(ufile)
+  set undofile& undolevels& cryptmethod&
+endfunc
+
+" Test 'undofile' using a file encrypted with 'blowfish2' crypt method
+func Test_undofile_cryptmethod_blowfish2()
+  edit Xtestfile
+  set undofile cryptmethod=blowfish2
+  call append(0, ['jan', 'feb', 'mar', 'apr', 'jun'])
+  call cursor(5, 1)
+
+  set undolevels=100
+  exe 'normal kk0ifoo '
+  set undolevels=100
+  normal dd
+  set undolevels=100
+  exe 'normal ibar '
+  set undolevels=100
+  " encrypt the file using key 'foo2bar'
+  call feedkeys("foo2bar\nfoo2bar\n")
+  X
+  write!
+  bwipe!
+
+  call feedkeys("foo2bar\n")
+  edit Xtestfile
+  set key=
+  call search('bar')
+  call assert_equal('bar apr', getline('.'))
+  normal u
+  call assert_equal('apr', getline('.'))
+  normal u
+  call assert_equal('foo mar', getline('.'))
+  normal u
+  call assert_equal('mar', getline('.'))
+
+  bwipe!
+  call delete('Xtestfile')
+  let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~'
+  call delete(ufile)
+  set undofile& undolevels& cryptmethod&
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
index 6c31de8c913611c798302df923c0629dfdda3f6f..a45bb166c4951e5a5bce0e49f8b5742f8924cb5b 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    8,
 /**/
     7,
 /**/