view src/testdir/test71.in @ 4460:fe8a0a6a1c2a v7.3.978

updated for version 7.3.978 Problem: Regexp debug logs don't have a good name. Solution: Use clear names and make it possible to write logs for the old and new engines separately. (Taro Muraoka)
author Bram Moolenaar <bram@vim.org>
date Mon, 20 May 2013 21:49:13 +0200
parents d8e4b27cef80
children 5cd32322154c
line wrap: on
line source

Test for encryption.

STARTTEST
:so small.vim
:/^start of text/+1
:let text_lines = getline('.', line('.') + 2)
:/^start of cm=zip bytes/+1
:let cm0_bytes = getline('.', '.')
:/^start of cm=blowfish bytes/+1
:let cm1_bytes = getline('.', '.')
:bwipe
:call append(0, text_lines)
:$d
:X
foobar
foobar
:w! Xtestfile
:bwipe!
:e Xtestfile
foobar
:let cm0_read_back = getline('.', '$')
:set key=
:set cryptmethod=blowfish
:" If the blowfish test fails 'cryptmethod' will be 'zip' now.
:%s/^/\=&cryptmethod == 'blowfish' ? "OK " : "blowfish test failed "/
:X
barfoo
barfoo
:w! Xtestfile
:bwipe!
:e Xtestfile
barfoo
:let cm1_read_back = getline('.', '$')
:bwipe!
:set bin noeol key=
:call append(0, cm0_bytes)
:$d
:set fenc=latin1
:w! Xtestfile
:bwipe!
:set nobin
:e Xtestfile
foofoo
:let cm0_read_bin = getline('.', '$')
:bwipe!
:set bin noeol key=
:call append(0, cm1_bytes)
:$d
:set fenc=latin1
:w! Xtestfile
:bwipe!
:set nobin
:e Xtestfile
barbar
:call append(0, cm0_read_bin)
:call append(0, cm1_read_back)
:call append(0, cm0_read_back)
:set key= fenc=latin1
:w! test.out
:qa!
ENDTEST

start of text
01234567890123456789012345678901234567
line 2  foo bar blah
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
end of text

start of cm=zip bytes
VimCrypt~01!lV'Þ}Mg ê£V©çE#3Ž2Ué—
end of cm=zip bytes

start of cm=blowfish bytes
VimCrypt~02!k)¾—#ÝSœõ=ºàÈ#¥M´†JÃAÍ¥M´†!€›õáÒ‚˜÷
Ú
end of cm=blowfish bytes