Mercurial > vim
annotate src/testdir/test91.in @ 5480:82ace7765f3a
Added tag v7-4-089 for changeset 6707c44cec61
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 12 Nov 2013 05:12:03 +0100 |
parents | 74d2f3188cd0 |
children | 4176c48c7dd5 |
rev | line source |
---|---|
4157 | 1 Tests for getbufvar(), getwinvar(), gettabvar() and gettabwinvar(). |
2 vim: set ft=vim : | |
3 | |
4 STARTTEST | |
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 | 7 :" |
4297 | 8 :" Test for getbufvar() |
9 :" Use strings to test for memory leaks. | |
10 :let b:var_num = '1234' | |
11 :let def_num = '5678' | |
4157 | 12 :$put =string(getbufvar(1, 'var_num')) |
13 :$put =string(getbufvar(1, 'var_num', def_num)) | |
14 :$put =string(getbufvar(1, '')) | |
15 :$put =string(getbufvar(1, '', def_num)) | |
16 :unlet b:var_num | |
17 :$put =string(getbufvar(1, 'var_num', def_num)) | |
18 :$put =string(getbufvar(1, '')) | |
19 :$put =string(getbufvar(1, '', def_num)) | |
20 :$put =string(getbufvar(9, '')) | |
21 :$put =string(getbufvar(9, '', def_num)) | |
22 :unlet def_num | |
23 :$put =string(getbufvar(1, '&autoindent')) | |
24 :$put =string(getbufvar(1, '&autoindent', 1)) | |
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 | 37 :" test for getwinvar() |
38 :let w:var_str = "Dance" | |
39 :let def_str = "Chance" | |
40 :$put =string(getwinvar(1, 'var_str')) | |
41 :$put =string(getwinvar(1, 'var_str', def_str)) | |
42 :$put =string(getwinvar(1, '')) | |
43 :$put =string(getwinvar(1, '', def_str)) | |
44 :unlet w:var_str | |
45 :$put =string(getwinvar(1, 'var_str', def_str)) | |
46 :$put =string(getwinvar(1, '')) | |
47 :$put =string(getwinvar(1, '', def_str)) | |
48 :$put =string(getwinvar(9, '')) | |
49 :$put =string(getwinvar(9, '', def_str)) | |
50 :$put =string(getwinvar(1, '&nu')) | |
51 :$put =string(getwinvar(1, '&nu', 1)) | |
52 :unlet def_str | |
53 :" | |
54 :" test for gettabvar() | |
55 :tabnew | |
56 :tabnew | |
57 :let t:var_list = [1, 2, 3] | |
58 :let def_list = [4, 5, 6, 7] | |
59 :tabrewind | |
60 :$put =string(gettabvar(3, 'var_list')) | |
61 :$put =string(gettabvar(3, 'var_list', def_list)) | |
62 :$put =string(gettabvar(3, '')) | |
63 :$put =string(gettabvar(3, '', def_list)) | |
64 :tablast | |
65 :unlet t:var_list | |
66 :tabrewind | |
67 :$put =string(gettabvar(3, 'var_list', def_list)) | |
68 :$put =string(gettabvar(9, '')) | |
69 :$put =string(gettabvar(9, '', def_list)) | |
70 :$put =string(gettabvar(3, '&nu')) | |
71 :$put =string(gettabvar(3, '&nu', def_list)) | |
72 :unlet def_list | |
73 :tabonly | |
74 :" | |
75 :" test for gettabwinvar() | |
76 :tabnew | |
77 :tabnew | |
78 :tabprev | |
79 :split | |
80 :split | |
81 :wincmd w | |
82 :vert split | |
83 :wincmd w | |
84 :let w:var_dict = {'dict': 'tabwin'} | |
85 :let def_dict = {'dict2': 'newval'} | |
86 :wincmd b | |
87 :tabrewind | |
88 :$put =string(gettabwinvar(2, 3, 'var_dict')) | |
89 :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict)) | |
90 :$put =string(gettabwinvar(2, 3, '')) | |
91 :$put =string(gettabwinvar(2, 3, '', def_dict)) | |
92 :tabnext | |
93 :3wincmd w | |
94 :unlet w:var_dict | |
95 :tabrewind | |
96 :$put =string(gettabwinvar(2, 3, 'var_dict', def_dict)) | |
97 :$put =string(gettabwinvar(2, 3, '')) | |
98 :$put =string(gettabwinvar(2, 3, '', def_dict)) | |
99 :$put =string(gettabwinvar(2, 9, '')) | |
100 :$put =string(gettabwinvar(2, 9, '', def_dict)) | |
101 :$put =string(gettabwinvar(9, 3, '')) | |
102 :$put =string(gettabwinvar(9, 3, '', def_dict)) | |
103 :unlet def_dict | |
104 :$put =string(gettabwinvar(2, 3, '&nux')) | |
105 :$put =string(gettabwinvar(2, 3, '&nux', 1)) | |
106 :tabonly | |
107 :" | |
108 :/^start/,$wq! test.out | |
109 ENDTEST | |
110 | |
111 start: |