Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

58 lines (55 sloc) 1.394 kB
Tests for tab pages
:so small.vim
:" Simple test for opening and closing a tab page
:let nr = tabpagenr()
:call append(line('$'), 'tab page ' . nr)
:unlet nr
:" Open three tab pages and use ":tabdo"
:tabdo call append(line('$'), 'this is tab page ' . tabpagenr())
:tabclose! 2
:let line1 = getline('$')
:let line2 = getline('$')
:call append(line('$'), line1)
:call append(line('$'), line2)
:unlet line1 line2
:" Test for settabvar() and gettabvar() functions. Open a new tab page and
:" set 3 variables to a number, string and a list. Verify that the variables
:" are correctly set.
:call settabvar(2, 'val_num', 100)
:call settabvar(2, 'val_str', 'SetTabVar test')
:call settabvar(2, 'val_list', ['red', 'blue', 'green'])
:let test_status = 'gettabvar: fail'
:if gettabvar(2, 'val_num') == 100 && gettabvar(2, 'val_str') == 'SetTabVar test') && gettabvar(2, 'val_list') == ['red', 'blue', 'green'])
: let test_status = 'gettabvar: pass'
:call append(line('$'), test_status)
:tabnext 2
:let test_status = 'settabvar: fail'
:if t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green']
: let test_status = 'settabvar: pass'
:call append(line('$'), test_status)
:/^Results/,$w! test.out
Jump to Line
Something went wrong with that request. Please try again.