1Test for encryption. 2 3STARTTEST 4:so small.vim 5:/^start of text/+1 6:let text_lines = getline('.', line('.') + 2) 7:/^start of cm=zip bytes/+1 8:let cm0_bytes = getline('.', '.') 9:/^start of cm=blowfish bytes/+1 10:let cm1_bytes = getline('.', '.') 11:bwipe 12:call append(0, text_lines) 13:$d 14:X 15foobar 16foobar 17:w! Xtestfile 18:bwipe! 19:e Xtestfile 20foobar 21:let cm0_read_back = getline('.', '$') 22:set key= 23:set cryptmethod=blowfish 24:" If the blowfish test fails 'cryptmethod' will be 'zip' now. 25:%s/^/\=&cryptmethod == 'blowfish' ? "OK " : "blowfish test failed "/ 26:X 27barfoo 28barfoo 29:w! Xtestfile 30:bwipe! 31:e Xtestfile 32barfoo 33:let cm1_read_back = getline('.', '$') 34:bwipe! 35:set bin noeol key= 36:call append(0, cm0_bytes) 37:$d 38:set fenc=latin1 39:w! Xtestfile 40:bwipe! 41:set nobin 42:e Xtestfile 43foofoo 44:let cm0_read_bin = getline('.', '$') 45:bwipe! 46:set bin noeol key= 47:call append(0, cm1_bytes) 48:$d 49:set fenc=latin1 50:w! Xtestfile 51:bwipe! 52:set nobin 53:e Xtestfile 54barbar 55:call append(0, cm0_read_bin) 56:call append(0, cm1_read_back) 57:call append(0, cm0_read_back) 58:set key= fenc=latin1 59:w! test.out 60:qa! 61ENDTEST 62 63start of text 6401234567890123456789012345678901234567 65line 2 foo bar blah 66line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 67end of text 68 69start of cm=zip bytes 70VimCrypt~01!lV'�}Mg��V��E#3�2U� 71end of cm=zip bytes 72 73start of cm=blowfish bytes 74VimCrypt~02!k)��#�S��=���#�M��J�AͥM��!�������� 75� 76end of cm=blowfish bytes 77