Mercurial > vim
view src/testdir/test71.in @ 2204:c493d6bfde09 vim73
A few more changes for encryption. Add test that encrypted file can be read.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 21 May 2010 15:36:08 +0200 |
parents | f60a0c9cbe6c |
children | b7cb69ab616d |
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=0 bytes/+1 :let cm0_bytes = getline('.', '.') :/^start of cm=1 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=1 :" If the blowfish test fails 'cryptmethod' will be 0 now. :%s/^/\=&cryptmethod == 1 ? "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=0 bytes VimCrypt~01!lV'Þ}Mg ê£V©çE#3Ž2Ué— end of cm=0 bytes start of cm=1 bytes VimCrypt~02!¨Ò9ZšÙ¢èì”F¼èÃ[,ì”F¼ƒ€z¼Ö軂y¾Ô( end of cm=1 bytes