view src/testdir/test72.in @ 9760:96667173293d v7.4.2155

commit https://github.com/vim/vim/commit/9d5b876d458e242b8b5e44da10c5cdc6bbb7f57c Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 4 21:21:13 2016 +0200 patch 7.4.2155 Problem: Quotes make GUI test fail on MS-Windows. Solution: Remove quotes, strip white space.
author Christian Brabandt <cb@256bit.org>
date Thu, 04 Aug 2016 21:30:07 +0200
parents fd4dc6581b0e
children ae45d497868f
line wrap: on
line source

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
:"
:" Test 'undofile': first a simple one-line change.
:set nocompatible viminfo+=nviminfo visualbell
:set ul=100 undofile nomore
:e! Xtestfile
ggdGithis is one line: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
:" TODO: this beeps
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: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
u: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: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:set ul=100
kk0ifoo :set ul=100
dd:set ul=100
ibar :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:set ul=100
kk0ifoo :set ul=100
dd:set ul=100
ibar :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