view src/testdir/test71.in @ 9735:8037eb704e93 v7.4.2143

commit https://github.com/vim/vim/commit/bc7ce675b2d1c9fb58c067eff3edd59abc30aba4 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 1 22:49:22 2016 +0200 patch 7.4.2143 Problem: A funccal is garbage collected while it can still be used. Solution: Set copyID in all referenced functions. Do not list lambda functions with ":function".
author Christian Brabandt <cb@256bit.org>
date Mon, 01 Aug 2016 23:00:07 +0200
parents 18ac55444b37
children
line wrap: on
line source

Test for encryption.
The test data is in another file to avoid problems with 'encoding', especially
cp932.

STARTTEST
:so small.vim
:set enc=latin1
:bwipe!
:r test71a.in
:/^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('.', '.')
:/^start of cm=blowfish2 bytes/+1
:let cm2_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('.', '$')
:set key=
:set cryptmethod=blowfish2
:" If the blowfish test fails 'cryptmethod' will be 'zip' now.
:%s/^/\=&cryptmethod == 'blowfish2' ? "OK " : "blowfish test failed "/
:X
bar2foo
bar2foo
:w! Xtestfile
:bwipe!
:e Xtestfile
bar2foo
:let cm2_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
:let cm1_read_bin = getline('.', '$')
:bwipe!
:set bin noeol key=
:call append(0, cm2_bytes)
:$d
:set fenc=latin1
:w! Xtestfile
:bwipe!
:set nobin
:e Xtestfile
barburp
:call append(0, cm1_read_bin)
:call append(0, cm0_read_bin)
:call append(0, cm2_read_back)
:call append(0, cm1_read_back)
:call append(0, cm0_read_back)
:set key= fenc=latin1
:w! test.out
:qa!
ENDTEST