annotate src/testdir/test62.in @ 4323:f1eab4f77a6f v7.3.911

updated for version 7.3.911 Problem: Python: Access to Vim variables is not so easy. Solution: Define vim.vars and vim.vvars. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Wed, 24 Apr 2013 14:07:45 +0200
parents e5b925ae56e3
children c80838526eeb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
1 Tests for tab pages
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
2
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
3 STARTTEST
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
4 :so small.vim
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
5 :" Simple test for opening and closing a tab page
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
6 :tabnew
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
7 :let nr = tabpagenr()
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
8 :q
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
9 :call append(line('$'), 'tab page ' . nr)
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 856
diff changeset
10 :unlet nr
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
11 :"
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
12 :" Open three tab pages and use ":tabdo"
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
13 :0tabnew
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
14 :1tabnew
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
15 :888tabnew
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
16 :tabdo call append(line('$'), 'this is tab page ' . tabpagenr())
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
17 :tabclose! 2
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
18 :tabrewind
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
19 :let line1 = getline('$')
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
20 :undo
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
21 :q
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
22 :tablast
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
23 :let line2 = getline('$')
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
24 :q!
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
25 :call append(line('$'), line1)
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
26 :call append(line('$'), line2)
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 856
diff changeset
27 :unlet line1 line2
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
28 :"
2240
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
29 :" Test for settabvar() and gettabvar() functions. Open a new tab page and
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
30 :" set 3 variables to a number, string and a list. Verify that the variables
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
31 :" are correctly set.
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
32 :tabnew
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
33 :tabfirst
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
34 :call settabvar(2, 'val_num', 100)
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
35 :call settabvar(2, 'val_str', 'SetTabVar test')
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
36 :call settabvar(2, 'val_list', ['red', 'blue', 'green'])
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
37 :"
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
38 :let test_status = 'gettabvar: fail'
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
39 :if gettabvar(2, 'val_num') == 100 && gettabvar(2, 'val_str') == 'SetTabVar test') && gettabvar(2, 'val_list') == ['red', 'blue', 'green'])
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
40 : let test_status = 'gettabvar: pass'
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
41 :endif
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
42 :call append(line('$'), test_status)
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
43 :"
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
44 :tabnext 2
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
45 :let test_status = 'settabvar: fail'
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
46 :if t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green']
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
47 : let test_status = 'settabvar: pass'
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
48 :endif
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
49 :tabclose
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
50 :call append(line('$'), test_status)
6b4879aea261 Add test for gettabvar() and settabvar().
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
51 :"
3408
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
52 :if has('gui') || has('clientserver')
3380
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
53 :" Test for ":tab drop exist-file" to keep current window.
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
54 :sp test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
55 :tab drop test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
56 :let test_status = 'tab drop 1: fail'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
57 :if tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
58 : let test_status = 'tab drop 1: pass'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
59 :endif
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
60 :close
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
61 :call append(line('$'), test_status)
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
62 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
63 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
64 :" Test for ":tab drop new-file" to keep current window of tabpage 1.
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
65 :split
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
66 :tab drop newfile
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
67 :let test_status = 'tab drop 2: fail'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
68 :if tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
69 : let test_status = 'tab drop 2: pass'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
70 :endif
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
71 :tabclose
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
72 :q
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
73 :call append(line('$'), test_status)
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
74 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
75 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
76 :" Test for ":tab drop multi-opend-file" to keep current tabpage and window.
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
77 :new test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
78 :tabnew
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
79 :new test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
80 :tab drop test1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
81 :let test_status = 'tab drop 3: fail'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
82 :if tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
83 : let test_status = 'tab drop 3: pass'
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
84 :endif
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
85 :tabclose
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
86 :q
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
87 :call append(line('$'), test_status)
3408
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
88 :else
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
89 :" :drop not supported
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
90 :call append(line('$'), 'tab drop 1: pass')
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
91 :call append(line('$'), 'tab drop 2: pass')
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
92 :call append(line('$'), 'tab drop 3: pass')
636e4db6e207 updated for version 7.3.470
Bram Moolenaar <bram@vim.org>
parents: 3380
diff changeset
93 :endif
3380
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
94 :"
07fd030f89be updated for version 7.3.456
Bram Moolenaar <bram@vim.org>
parents: 2240
diff changeset
95 :"
3662
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
96 :for i in range(9) | tabnew | endfor
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
97 1gt
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
98 Go=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
99 :tabmove 5
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
100 i=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
101 :tabmove -2
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
102 i=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
103 :tabmove +4
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
104 i=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
105 :tabmove
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
106 i=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
107 :tabmove -20
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
108 i=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
109 :tabmove +20
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
110 i=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
111 :3tabmove
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
112 i=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
113 :7tabmove 5
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
114 i=tabpagenr() 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
115 :let a='No error caught.'
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
116 :try
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
117 :tabmove foo
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
118 :catch E474
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
119 :let a='E474 caught.'
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
120 :endtry
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
121 i=a 
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
122 :"
e5b925ae56e3 updated for version 7.3.591
Bram Moolenaar <bram@vim.org>
parents: 3408
diff changeset
123 :"
856
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
124 :/^Results/,$w! test.out
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
125 :qa!
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
126 ENDTEST
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
127
8cd729851562 updated for version 7.0g
vimboss
parents:
diff changeset
128 Results: