1Tests for tab pages
2
3STARTTEST
4:so small.vim
5:" Simple test for opening and closing a tab page
6:tabnew
7:let nr = tabpagenr()
8:q
9:call append(line('$'), 'tab page ' . nr)
10:unlet nr
11:"
12:" Open three tab pages and use ":tabdo"
13:0tabnew
14:1tabnew
15:888tabnew
16:tabdo call append(line('$'), 'this is tab page ' . tabpagenr())
17:tabclose! 2
18:tabrewind
19:let line1 = getline('$')
20:undo
21:q
22:tablast
23:let line2 = getline('$')
24:q!
25:call append(line('$'), line1)
26:call append(line('$'), line2)
27:unlet line1 line2
28:"
29:" Test for settabvar() and gettabvar() functions. Open a new tab page and 
30:" set 3 variables to a number, string and a list. Verify that the variables
31:" are correctly set.
32:tabnew
33:tabfirst
34:call settabvar(2, 'val_num', 100)
35:call settabvar(2, 'val_str', 'SetTabVar test')
36:call settabvar(2, 'val_list', ['red', 'blue', 'green'])
37:"
38:let test_status = 'gettabvar: fail'
39:if gettabvar(2, 'val_num') == 100 && gettabvar(2, 'val_str') == 'SetTabVar test') && gettabvar(2, 'val_list') == ['red', 'blue', 'green'])
40:    let test_status = 'gettabvar: pass'
41:endif
42:call append(line('$'), test_status)
43:"
44:tabnext 2
45:let test_status = 'settabvar: fail'
46:if t:val_num == 100 && t:val_str == 'SetTabVar test'  && t:val_list == ['red', 'blue', 'green']
47:   let test_status = 'settabvar: pass'
48:endif
49:tabclose
50:call append(line('$'), test_status)
51:"
52:"
53:/^Results/,$w! test.out
54:qa!
55ENDTEST
56
57Results:
58