annotate src/testdir/test_eval.in @ 10896:d513b653f5d0 v8.0.0337

patch 8.0.0337: invalid memory access in :recover command commit https://github.com/vim/vim/commit/c525e3a1c20f6b5d9809c8b84f80090a8e416c92 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 18 16:59:02 2017 +0100 patch 8.0.0337: invalid memory access in :recover command Problem: Invalid memory access in :recover command. Solution: Avoid access before directory name. (Dominique Pelle, closes #1488)
author Christian Brabandt <cb@256bit.org>
date Sat, 18 Feb 2017 17:00:05 +0100
parents 9c420b8db435
children 30f9a62f5f51
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
1 Test for various eval features. vim: set ft=vim :
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
2
6543
b01ca71f93b2 updated for version 7.4.598
Bram Moolenaar <bram@vim.org>
parents: 5944
diff changeset
3 Note: system clipboard is saved, changed and restored.
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
5 clipboard contents
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
6 something else
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
7
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 STARTTEST
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 :so small.vim
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
10 :set encoding=latin1
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
11 :set noswapfile
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
12 :lang C
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
13 :fun AppendRegContents(reg)
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
14 call AppendRegParts(a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1)))
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
15 :endfun
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
16 :fun AppendRegParts(reg, type, cont, strcont, cont1, strcont1)
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
17 call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, a:type, a:cont, a:strcont, a:cont1, a:strcont1))
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
18 endfun
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
19 :command -nargs=? AR :call AppendRegContents(<q-args>)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
20 :fun SetReg(...)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
21 call call('setreg', a:000)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
22 call append('$', printf('{{{2 setreg(%s)', string(a:000)[1:-2]))
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
23 call AppendRegContents(a:1)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
24 if a:1 isnot# '='
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
25 execute "silent normal! Go==\n==\e\"".a:1."P"
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
26 endif
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
27 endfun
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
28 :fun ErrExe(str)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
29 call append('$', 'Executing '.a:str)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
30 try
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
31 execute a:str
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
32 catch
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
33 $put =v:exception
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
34 endtry
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
35 endfun
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
36 :fun Test()
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
37 $put ='{{{1 let tests'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
38 let @" = 'abc'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
39 AR "
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
40 let @" = "abc\n"
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
41 AR "
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
42 let @" = "abc\<C-m>"
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
43 AR "
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
44 let @= = '"abc"'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
45 AR =
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
46
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
47 $put ='{{{1 Basic setreg tests'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
48 call SetReg('a', 'abcA', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
49 call SetReg('b', 'abcB', 'v')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
50 call SetReg('c', 'abcC', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
51 call SetReg('d', 'abcD', 'V')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
52 call SetReg('e', 'abcE', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
53 call SetReg('f', 'abcF', "\<C-v>")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
54 call SetReg('g', 'abcG', 'b10')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
55 call SetReg('h', 'abcH', "\<C-v>10")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
56 call SetReg('I', 'abcI')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
57
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
58 $put ='{{{1 Appending single lines with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
59 call SetReg('A', 'abcAc', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
60 call SetReg('A', 'abcAl', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
61 call SetReg('A', 'abcAc2','c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
62 call SetReg('b', 'abcBc', 'ca')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
63 call SetReg('b', 'abcBb', 'ba')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
64 call SetReg('b', 'abcBc2','ca')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
65 call SetReg('b', 'abcBb2','b50a')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
66
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
67 call SetReg('C', 'abcCl', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
68 call SetReg('C', 'abcCc', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
69 call SetReg('D', 'abcDb', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
70
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
71 call SetReg('E', 'abcEb', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
72 call SetReg('E', 'abcEl', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
73 call SetReg('F', 'abcFc', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
74
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
75 $put ='{{{1 Appending NL with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
76 call setreg('a', 'abcA2', 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
77 call setreg('b', 'abcB2', 'v')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
78 call setreg('c', 'abcC2', 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
79 call setreg('d', 'abcD2', 'V')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
80 call setreg('e', 'abcE2', 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
81 call setreg('f', 'abcF2', "\<C-v>")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
82 call setreg('g', 'abcG2', 'b10')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
83 call setreg('h', 'abcH2', "\<C-v>10")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
84 call setreg('I', 'abcI2')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
85
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
86 call SetReg('A', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
87 call SetReg('B', "\n", 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
88 call SetReg('C', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
89 call SetReg('D', "\n", 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
90 call SetReg('E', "\n")
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
91 call SetReg('F', "\n", 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
92
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
93 $put ='{{{1 Setting lists with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
94 call SetReg('a', ['abcA3'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
95 call SetReg('b', ['abcB3'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
96 call SetReg('c', ['abcC3'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
97 call SetReg('d', ['abcD3'])
5810
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
98 call SetReg('e', [1, 2, 'abc', 3])
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
99 call SetReg('f', [1, 2, 3])
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
100
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
101 $put ='{{{1 Appending lists with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
102 call SetReg('A', ['abcA3c'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
103 call SetReg('b', ['abcB3l'], 'la')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
104 call SetReg('C', ['abcC3b'], 'lb')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
105 call SetReg('D', ['abcD32'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
106
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
107 call SetReg('A', ['abcA32'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
108 call SetReg('B', ['abcB3c'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
109 call SetReg('C', ['abcC3l'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
110 call SetReg('D', ['abcD3b'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
111
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
112 $put ='{{{1 Appending lists with NL with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
113 call SetReg('A', ["\n", 'abcA3l2'], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
114 call SetReg('B', ["\n", 'abcB3c2'], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
115 call SetReg('C', ["\n", 'abcC3b2'], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
116 call SetReg('D', ["\n", 'abcD3b50'],'b50')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
117
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
118 $put ='{{{1 Setting lists with NLs with setreg()'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
119 call SetReg('a', ['abcA4-0', "\n", "abcA4-2\n", "\nabcA4-3", "abcA4-4\nabcA4-4-2"])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
120 call SetReg('b', ['abcB4c-0', "\n", "abcB4c-2\n", "\nabcB4c-3", "abcB4c-4\nabcB4c-4-2"], 'c')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
121 call SetReg('c', ['abcC4l-0', "\n", "abcC4l-2\n", "\nabcC4l-3", "abcC4l-4\nabcC4l-4-2"], 'l')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
122 call SetReg('d', ['abcD4b-0', "\n", "abcD4b-2\n", "\nabcD4b-3", "abcD4b-4\nabcD4b-4-2"], 'b')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
123 call SetReg('e', ['abcE4b10-0', "\n", "abcE4b10-2\n", "\nabcE4b10-3", "abcE4b10-4\nabcE4b10-4-2"], 'b10')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
124
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
125 $put ='{{{1 Search and expressions'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
126 call SetReg('/', ['abc/'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
127 call SetReg('/', ["abc/\n"])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
128 call SetReg('=', ['"abc/"'])
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
129 call SetReg('=', ["\"abc/\n\""])
6543
b01ca71f93b2 updated for version 7.4.598
Bram Moolenaar <bram@vim.org>
parents: 5944
diff changeset
130 $put ='{{{1 System clipboard'
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
131 if has('clipboard')
6543
b01ca71f93b2 updated for version 7.4.598
Bram Moolenaar <bram@vim.org>
parents: 5944
diff changeset
132 " Save and restore system clipboard.
b01ca71f93b2 updated for version 7.4.598
Bram Moolenaar <bram@vim.org>
parents: 5944
diff changeset
133 " If no connection to X-Server is possible, test should succeed.
6571
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
134 let _clipreg = ['*', getreg('*'), getregtype('*')]
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
135 let _clipopt = &cb
6571
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
136 let &cb='unnamed'
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
137 5y
6571
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
138 AR *
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
139 tabdo :windo :echo "hi"
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
140 6y
6571
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
141 AR *
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
142 let &cb=_clipopt
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
143 call call('setreg', _clipreg)
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
144 else
6571
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
145 call AppendRegParts('*', 'V', "clipboard contents\n", "['clipboard contents']", "clipboard contents\n", "['clipboard contents']")
75238dbe8543 updated for version 7.4.612
Bram Moolenaar <bram@vim.org>
parents: 6563
diff changeset
146 call AppendRegParts('*', 'V', "something else\n", "['something else']", "something else\n", "['something else']")
6563
6b86d256fd33 updated for version 7.4.608
Bram Moolenaar <bram@vim.org>
parents: 6543
diff changeset
147 endif
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
148 $put ='{{{1 Errors'
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
149 call ErrExe('call setreg()')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
150 call ErrExe('call setreg(1)')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
151 call ErrExe('call setreg(1, 2, 3, 4)')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
152 call ErrExe('call setreg([], 2)')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
153 call ErrExe('call setreg(1, {})')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
154 call ErrExe('call setreg(1, 2, [])')
5810
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
155 call ErrExe('call setreg("/", ["1", "2"])')
0b9a66ea49f4 updated for version 7.4.249
Bram Moolenaar <bram@vim.org>
parents: 5798
diff changeset
156 call ErrExe('call setreg("=", ["1", "2"])')
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
157 call ErrExe('call setreg(1, ["", "", [], ""])')
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
158 endfun
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
159 :"
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
160 :call Test()
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
161 :"
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
162 :delfunction SetReg
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
163 :delfunction AppendRegContents
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
164 :delfunction ErrExe
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
165 :delfunction Test
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
166 :delcommand AR
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
167 :call garbagecollect(1)
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
168 :"
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
169 :" function name not starting with capital
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
170 :try
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
171 :func! g:test()
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
172 :echo "test"
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
173 :endfunc
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
174 :catch
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
175 :$put =v:exception
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
176 :endtry
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
177 :"
5834
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
178 :" function name includes a colon
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
179 :try
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
180 :func! b:test()
5834
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
181 :echo "test"
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
182 :endfunc
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
183 :catch
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
184 :$put =v:exception
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
185 :endtry
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
186 :"
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
187 :" function name folowed by #
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
188 :try
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
189 :func! test2() "#
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
190 :echo "test2"
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
191 :endfunc
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
192 :catch
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
193 :$put =v:exception
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
194 :endtry
6bc874e4789a updated for version 7.4.260
Bram Moolenaar <bram@vim.org>
parents: 5810
diff changeset
195 :"
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
196 :" function name starting with/without "g:", buffer-local funcref.
5844
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
197 :function! g:Foo(n)
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
198 : $put ='called Foo(' . a:n . ')'
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
199 :endfunction
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
200 :let b:my_func = function('Foo')
5844
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
201 :call b:my_func(1)
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
202 :echo g:Foo(2)
8ec9d2196bee updated for version 7.4.265
Bram Moolenaar <bram@vim.org>
parents: 5842
diff changeset
203 :echo Foo(3)
5842
00acac0af680 updated for version 7.4.264
Bram Moolenaar <bram@vim.org>
parents: 5834
diff changeset
204 :"
5850
1a5ed2626b26 updated for version 7.4.268
Bram Moolenaar <bram@vim.org>
parents: 5844
diff changeset
205 :" script-local function used in Funcref must exist.
1a5ed2626b26 updated for version 7.4.268
Bram Moolenaar <bram@vim.org>
parents: 5844
diff changeset
206 :so test_eval_func.vim
1a5ed2626b26 updated for version 7.4.268
Bram Moolenaar <bram@vim.org>
parents: 5844
diff changeset
207 :"
5858
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
208 :" Using $ instead of '$' must give an error
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
209 :try
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
210 : call append($, 'foobar')
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
211 :catch
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
212 :$put =v:exception
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
213 :endtry
00228400629e updated for version 7.4.272
Bram Moolenaar <bram@vim.org>
parents: 5850
diff changeset
214 :"
5944
332a5c2b2956 updated for version 7.4.313
Bram Moolenaar <bram@vim.org>
parents: 5938
diff changeset
215 :$put ='{{{1 getcurpos/setpos'
5938
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
216 /^012345678
5944
332a5c2b2956 updated for version 7.4.313
Bram Moolenaar <bram@vim.org>
parents: 5938
diff changeset
217 6l:let sp = getcurpos()
5938
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
218 0:call setpos('.', sp)
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
219 jyl:$put
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
220 :"
7611
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
221 :" substring and variable name
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
222 :let str = 'abcdef'
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
223 :let n = 3
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
224 :$put =str[n:]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
225 :$put =str[:n]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
226 :$put =str[n:n]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
227 :unlet n
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
228 :let nn = 3
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
229 :$put =str[nn:]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
230 :$put =str[:nn]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
231 :$put =str[nn:nn]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
232 :unlet nn
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
233 :let b:nn = 4
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
234 :$put =str[b:nn:]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
235 :$put =str[:b:nn]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
236 :$put =str[b:nn:b:nn]
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
237 :unlet b:nn
9c420b8db435 commit https://github.com/vim/vim/commit/9bbf63dbf8286fadc0cd6b3428010abb67b1b64d
Christian Brabandt <cb@256bit.org>
parents: 6571
diff changeset
238 :"
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
239 :/^start:/+1,$wq! test.out
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
240 :" vim: et ts=4 isk-=\: fmr=???,???
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
241 :call getchar()
5796
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
242 ENDTEST
f084024c0ddb updated for version 7.4.242
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
243
5938
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
244 012345678
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
245 012345678
ccac0aa34eea updated for version 7.4.310
Bram Moolenaar <bram@vim.org>
parents: 5858
diff changeset
246
5798
9f8fa56f1906 updated for version 7.4.243
Bram Moolenaar <bram@vim.org>
parents: 5796
diff changeset
247 start: