annotate src/testdir/test91.in @ 5776:845608965bd9 v7.4.232

updated for version 7.4.232 Problem: ":%s/\n//" uses a lot of memory. (Aidan Marlin) Solution: Turn this into a join command. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Tue, 01 Apr 2014 17:49:44 +0200
parents 74d2f3188cd0
children 4176c48c7dd5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4157
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 Tests for getbufvar(), getwinvar(), gettabvar() and gettabwinvar().
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 vim: set ft=vim :
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 STARTTEST
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5 :so small.vim
5231
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
6 :so mbyte.vim
4157
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 :"
4297
aca1886102bd updated for version 7.3.898
Bram Moolenaar <bram@vim.org>
parents: 4157
diff changeset
8 :" Test for getbufvar()
aca1886102bd updated for version 7.3.898
Bram Moolenaar <bram@vim.org>
parents: 4157
diff changeset
9 :" Use strings to test for memory leaks.
aca1886102bd updated for version 7.3.898
Bram Moolenaar <bram@vim.org>
parents: 4157
diff changeset
10 :let b:var_num = '1234'
aca1886102bd updated for version 7.3.898
Bram Moolenaar <bram@vim.org>
parents: 4157
diff changeset
11 :let def_num = '5678'
4157
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 :$put =string(getbufvar(1, 'var_num'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13 :$put =string(getbufvar(1, 'var_num', def_num))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 :$put =string(getbufvar(1, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 :$put =string(getbufvar(1, '', def_num))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 :unlet b:var_num
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 :$put =string(getbufvar(1, 'var_num', def_num))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 :$put =string(getbufvar(1, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 :$put =string(getbufvar(1, '', def_num))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 :$put =string(getbufvar(9, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 :$put =string(getbufvar(9, '', def_num))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 :unlet def_num
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 :$put =string(getbufvar(1, '&autoindent'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 :$put =string(getbufvar(1, '&autoindent', 1))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 :"
5231
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
26 :" Open new window with forced option values
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
27 :set fileformats=unix,dos
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
28 :new ++ff=dos ++bin ++enc=iso-8859-2
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
29 :let otherff = getbufvar(bufnr('%'), '&fileformat')
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
30 :let otherbin = getbufvar(bufnr('%'), '&bin')
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
31 :let otherfenc = getbufvar(bufnr('%'), '&fenc')
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
32 :close
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
33 :$put =otherff
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
34 :$put =string(otherbin)
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
35 :$put =otherfenc
74d2f3188cd0 updated for version 7.4a.041
Bram Moolenaar <bram@vim.org>
parents: 4297
diff changeset
36 :unlet otherff otherbin otherfenc
4157
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 :" test for getwinvar()
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 :let w:var_str = "Dance"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 :let def_str = "Chance"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 :$put =string(getwinvar(1, 'var_str'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 :$put =string(getwinvar(1, 'var_str', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 :$put =string(getwinvar(1, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 :$put =string(getwinvar(1, '', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 :unlet w:var_str
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 :$put =string(getwinvar(1, 'var_str', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 :$put =string(getwinvar(1, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 :$put =string(getwinvar(1, '', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 :$put =string(getwinvar(9, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 :$put =string(getwinvar(9, '', def_str))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 :$put =string(getwinvar(1, '&nu'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 :$put =string(getwinvar(1, '&nu', 1))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 :unlet def_str
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 :"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 :" test for gettabvar()
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 :tabnew
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 :tabnew
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 :let t:var_list = [1, 2, 3]
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 :let def_list = [4, 5, 6, 7]
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59 :tabrewind
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 :$put =string(gettabvar(3, 'var_list'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 :$put =string(gettabvar(3, 'var_list', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 :$put =string(gettabvar(3, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63 :$put =string(gettabvar(3, '', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
64 :tablast
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
65 :unlet t:var_list
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66 :tabrewind
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
67 :$put =string(gettabvar(3, 'var_list', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68 :$put =string(gettabvar(9, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 :$put =string(gettabvar(9, '', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70 :$put =string(gettabvar(3, '&nu'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 :$put =string(gettabvar(3, '&nu', def_list))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 :unlet def_list
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
73 :tabonly
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74 :"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 :" test for gettabwinvar()
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 :tabnew
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
77 :tabnew
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
78 :tabprev
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
79 :split
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
80 :split
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
81 :wincmd w
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
82 :vert split
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83 :wincmd w
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
84 :let w:var_dict = {'dict': 'tabwin'}
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
85 :let def_dict = {'dict2': 'newval'}
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
86 :wincmd b
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87 :tabrewind
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
88 :$put =string(gettabwinvar(2, 3, 'var_dict'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
89 :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
90 :$put =string(gettabwinvar(2, 3, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
91 :$put =string(gettabwinvar(2, 3, '', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
92 :tabnext
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
93 :3wincmd w
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
94 :unlet w:var_dict
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
95 :tabrewind
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
96 :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
97 :$put =string(gettabwinvar(2, 3, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
98 :$put =string(gettabwinvar(2, 3, '', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
99 :$put =string(gettabwinvar(2, 9, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
100 :$put =string(gettabwinvar(2, 9, '', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
101 :$put =string(gettabwinvar(9, 3, ''))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
102 :$put =string(gettabwinvar(9, 3, '', def_dict))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
103 :unlet def_dict
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
104 :$put =string(gettabwinvar(2, 3, '&nux'))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
105 :$put =string(gettabwinvar(2, 3, '&nux', 1))
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
106 :tabonly
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 :"
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
108 :/^start/,$wq! test.out
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
109 ENDTEST
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
110
cb185366f5c8 updated for version 7.3.831
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
111 start: