Mercurial > vim
view src/testdir/test72.in @ 2456:2876ac15b8c8 vim73
Avoid that running tests changes viminfo.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 01 Aug 2010 15:47:03 +0200 |
parents | 9614fe67034c |
children | 64df5d008ccb |
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 :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 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 :" :" And now with encryption, cryptmethod=zip :e! Xtestfile :set undofile cm=zip ggdG imonday 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 :set undofile cm=blowfish ggdG ijan 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 :" :" Rename the undo file so that it gets cleaned up. :call rename(".Xtestfile.un~", "Xtestundo") :qa! ENDTEST 1111 ----- 2222 ----- 123456789