Mercurial > vim
annotate src/testdir/test71.in @ 7441:7017b495ca53 v7.4.1024
commit https://github.com/vim/vim/commit/d5c899a3f1d67a220e571dadf90dde1bbd41e166
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 2 15:07:02 2016 +0100
patch 7.4.1024
Problem: Interfaces for MS-Windows are outdated.
Solution: Use Python 2.7.10, Python 3.4.4, Perl 5.22, TCL 8.6.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Jan 2016 15:15:04 +0100 |
parents | 18ac55444b37 |
children |
rev | line source |
---|---|
2180
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
1 Test for encryption. |
5080
d6ceddc0be86
updated for version 7.3.1283
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
2 The test data is in another file to avoid problems with 'encoding', especially |
d6ceddc0be86
updated for version 7.3.1283
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
3 cp932. |
2180
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
4 |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
5 STARTTEST |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
6 :so small.vim |
5080
d6ceddc0be86
updated for version 7.3.1283
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
7 :set enc=latin1 |
d6ceddc0be86
updated for version 7.3.1283
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
8 :bwipe! |
d6ceddc0be86
updated for version 7.3.1283
Bram Moolenaar <bram@vim.org>
parents:
4956
diff
changeset
|
9 :r test71a.in |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
10 :/^start of text/+1 |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
11 :let text_lines = getline('.', line('.') + 2) |
2360
d8e4b27cef80
Change 'cryptmethod' from a number to a string option. Make it global-local.
Bram Moolenaar <bram@vim.org>
parents:
2265
diff
changeset
|
12 :/^start of cm=zip bytes/+1 |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
13 :let cm0_bytes = getline('.', '.') |
2360
d8e4b27cef80
Change 'cryptmethod' from a number to a string option. Make it global-local.
Bram Moolenaar <bram@vim.org>
parents:
2265
diff
changeset
|
14 :/^start of cm=blowfish bytes/+1 |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
15 :let cm1_bytes = getline('.', '.') |
6122 | 16 :/^start of cm=blowfish2 bytes/+1 |
17 :let cm2_bytes = getline('.', '.') | |
4956
5cd32322154c
updated for version 7.3.1223
Bram Moolenaar <bram@vim.org>
parents:
2360
diff
changeset
|
18 :bwipe! |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
19 :call append(0, text_lines) |
2180
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
20 :$d |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
21 :X |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
22 foobar |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
23 foobar |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
24 :w! Xtestfile |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
25 :bwipe! |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
26 :e Xtestfile |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
27 foobar |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
28 :let cm0_read_back = getline('.', '$') |
2180
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
29 :set key= |
2360
d8e4b27cef80
Change 'cryptmethod' from a number to a string option. Make it global-local.
Bram Moolenaar <bram@vim.org>
parents:
2265
diff
changeset
|
30 :set cryptmethod=blowfish |
d8e4b27cef80
Change 'cryptmethod' from a number to a string option. Make it global-local.
Bram Moolenaar <bram@vim.org>
parents:
2265
diff
changeset
|
31 :" If the blowfish test fails 'cryptmethod' will be 'zip' now. |
d8e4b27cef80
Change 'cryptmethod' from a number to a string option. Make it global-local.
Bram Moolenaar <bram@vim.org>
parents:
2265
diff
changeset
|
32 :%s/^/\=&cryptmethod == 'blowfish' ? "OK " : "blowfish test failed "/ |
2180
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
33 :X |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
34 barfoo |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
35 barfoo |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
36 :w! Xtestfile |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
37 :bwipe! |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
38 :e Xtestfile |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
39 barfoo |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
40 :let cm1_read_back = getline('.', '$') |
6122 | 41 :set key= |
42 :set cryptmethod=blowfish2 | |
43 :" If the blowfish test fails 'cryptmethod' will be 'zip' now. | |
44 :%s/^/\=&cryptmethod == 'blowfish2' ? "OK " : "blowfish test failed "/ | |
45 :X | |
46 bar2foo | |
47 bar2foo | |
48 :w! Xtestfile | |
49 :bwipe! | |
50 :e Xtestfile | |
51 bar2foo | |
52 :let cm2_read_back = getline('.', '$') | |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
53 :bwipe! |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
54 :set bin noeol key= |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
55 :call append(0, cm0_bytes) |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
56 :$d |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
57 :set fenc=latin1 |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
58 :w! Xtestfile |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
59 :bwipe! |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
60 :set nobin |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
61 :e Xtestfile |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
62 foofoo |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
63 :let cm0_read_bin = getline('.', '$') |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
64 :bwipe! |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
65 :set bin noeol key= |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
66 :call append(0, cm1_bytes) |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
67 :$d |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
68 :set fenc=latin1 |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
69 :w! Xtestfile |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
70 :bwipe! |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
71 :set nobin |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
72 :e Xtestfile |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
73 barbar |
6122 | 74 :let cm1_read_bin = getline('.', '$') |
75 :bwipe! | |
76 :set bin noeol key= | |
77 :call append(0, cm2_bytes) | |
78 :$d | |
79 :set fenc=latin1 | |
80 :w! Xtestfile | |
81 :bwipe! | |
82 :set nobin | |
83 :e Xtestfile | |
84 barburp | |
85 :call append(0, cm1_read_bin) | |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
86 :call append(0, cm0_read_bin) |
6122 | 87 :call append(0, cm2_read_back) |
2204
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
88 :call append(0, cm1_read_back) |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
89 :call append(0, cm0_read_back) |
c493d6bfde09
A few more changes for encryption. Add test that encrypted file can be read.
Bram Moolenaar <bram@vim.org>
parents:
2180
diff
changeset
|
90 :set key= fenc=latin1 |
2180
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
91 :w! test.out |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
92 :qa! |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
93 ENDTEST |
f60a0c9cbe6c
Add the blowfish encryption patch from Mohsin Ahmed. Needs more work.
Bram Moolenaar <bram@vim.org>
parents:
diff
changeset
|
94 |