annotate src/testdir/test90.in @ 4143:f5ef9b9c18cd v7.3.824

updated for version 7.3.824 Problem: Can redefine builtin functions. (ZyX) Solution: Disallow adding a function to g:.
author Bram Moolenaar <bram@vim.org>
date Wed, 20 Feb 2013 15:19:43 +0100
parents 80ffecafc8f9
children bc269cf15ccd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4128
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 Tests for sha256() function. vim: set ft=vim et ts=2 sw=2 :
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 STARTTEST
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 :so small.vim
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 :if !has('cryptv') || !exists('*sha256')
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 e! test.ok
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 wq! test.out
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 :endif
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 :"
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 :let testcase='test for empty string: '
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 :if sha256("") ==# 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 : let res='ok'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 :else
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 : let res='ng'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 :endif
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 :$put =testcase.res
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 :"
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 :let testcase='test for 1 char: '
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 :if sha256("a") ==# 'ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 : let res='ok'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 :else
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 : let res='ng'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 :endif
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 :$put =testcase.res
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 :"
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 :let testcase='test for 3 chars: '
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 :if sha256("abc") ==# 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 : let res='ok'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 :else
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 : let res='ng'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 :endif
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 :$put =testcase.res
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 :"
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 :let testcase='test for contains meta char: '
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 :if sha256("foo\nbar") ==# '807eff6267f3f926a21d234f7b0cf867a86f47e07a532f15e8cc39ed110ca776'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 : let res='ok'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 :else
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 : let res='ng'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 :endif
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 :$put =testcase.res
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 :"
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 :let testcase='test for contains non-ascii char: '
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 :if sha256("\xde\xad\xbe\xef") ==# '5f78c33274e43fa9de5659265c1d917e25c03722dcb0b8d27db8d5feaa813953'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 : let res='ok'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 :else
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 : let res='ng'
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 :endif
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 :$put =testcase.res
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 "
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 :/^start:/,$wq! test.out
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 ENDTEST
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52
80ffecafc8f9 Add test files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 start: