Mercurial > vim
view src/testdir/test78.in @ 12614:12f4408c7f69 v8.0.1185
patch 8.0.1185: Ruby library includes minor version number
commit https://github.com/vim/vim/commit/9202162c5c069c925b6b9bf84e546fbd362cdf46
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 12 12:33:43 2017 +0200
patch 8.0.1185: Ruby library includes minor version number
Problem: Ruby library includes minor version number.
Solution: Only use the API version number. (Ben Boeckel, closes https://github.com/vim/vim/issues/2199)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 12 Oct 2017 12:45:07 +0200 |
parents | ae45d497868f |
children |
line wrap: on
line source
Inserts 10000 lines with text to fill the swap file with two levels of pointer blocks. Then recovers from the swap file and checks all text is restored. We need about 10000 lines of 100 characters to get two levels of pointer blocks. STARTTEST :so small.vim :set nocp fileformat=unix undolevels=-1 viminfo+=nviminfo belloff=all :e! Xtest ggdG :let text = "\tabcdefghijklmnoparstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnoparstuvwxyz0123456789" :let i = 1 :let linecount = 10000 :while i <= linecount | call append(i - 1, i . text) | let i += 1 | endwhile :preserve :" get the name of the swap file :redir => swapname :swapname :redir END :let swapname = substitute(swapname, '[[:blank:][:cntrl:]]*\(.\{-}\)[[:blank:][:cntrl:]]*$', '\1', '') :" make a copy of the swap file in Xswap :set bin :exe 'sp ' . swapname :w! Xswap :echo swapname :set nobin :new :only! :bwipe! Xtest :call rename('Xswap', swapname) :recover Xtest :call delete(swapname) :new :call append(0, 'recovery start') :wincmd w :let linedollar = line('$') :if linedollar < linecount | exe 'wincmd w' | call append(line('$'), "expected " . linecount . " lines but found only " . linedollar) | exe 'wincmd w' | let linecount = linedollar | endif :let i = 1 :while i <= linecount | if getline(i) != i . text | exe 'wincmd w' | call append(line('$'), i . ' differs') | exe 'wincmd w' | endif | let i += 1 | endwhile :q! :call append(line('$'), 'recovery end') :w! test.out :qa! ENDTEST