summaryrefslogtreecommitdiffstats
path: root/tests/test_vim/tests/tabline.vim
blob: ff76dc02ecdfe133d05282897aa82a8451f386a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/vim -S
set encoding=utf-8
let g:powerline_config_paths = [expand('<sfile>:p:h:h:h:h') . '/powerline/config_files']
source <sfile>:p:h:h:h:h/powerline/bindings/vim/plugin/powerline.vim
edit abc
tabedit def
tabedit ghi

redir => g:messages

try
	let &columns = 80
	let result = eval(&tabline[2:])
catch
	call writefile(['Exception while evaluating &tabline', v:exception], 'message.fail')
	cquit
endtry

if result isnot# '%1T%#Pl_247_10395294_236_3158064_NONE# 1 ./abc %#Pl_244_8421504_236_3158064_NONE# %2T%#Pl_247_10395294_236_3158064_NONE#2 ./def %#Pl_236_3158064_240_5789784_NONE# %3T%#Pl_250_12369084_240_5789784_NONE#3 ./%#Pl_231_16777215_240_5789784_bold#ghi %#Pl_240_5789784_236_3158064_NONE# %T%#Pl_231_16777215_236_3158064_NONE#                                         %#Pl_252_13684944_236_3158064_NONE# %#Pl_235_2500134_252_13684944_bold# Tabs '
	call writefile(['Unexpected tabline', result], 'message.fail')
	cquit
endif

tabonly!

try
	let result = eval(&tabline[2:])
catch
	call writefile(['Exception while evaluating &tabline (2)', v:exception], 'message.fail')
	cquit
endtry

if result isnot# '%T%#Pl_247_10395294_236_3158064_NONE# 1 ./abc %#Pl_244_8421504_236_3158064_NONE# %#Pl_247_10395294_236_3158064_NONE#2 ./def %#Pl_236_3158064_240_5789784_NONE# %#Pl_250_12369084_240_5789784_NONE#3 ./%#Pl_231_16777215_240_5789784_bold#ghi %#Pl_240_5789784_236_3158064_NONE# %#Pl_231_16777215_236_3158064_NONE#                                         %#Pl_252_13684944_236_3158064_NONE# %#Pl_235_2500134_252_13684944_bold# Bufs '
	call writefile(['Unexpected tabline (2)', result], 'message.fail')
	cquit
endif

try
	vsplit
	let result = eval(&tabline[2:])
catch
	call writefile(['Exception while evaluating &tabline (3)', v:exception], 'message.fail')
endtry

if result isnot# '%T%#Pl_247_10395294_236_3158064_NONE# 1 ./abc %#Pl_244_8421504_236_3158064_NONE# %#Pl_247_10395294_236_3158064_NONE#2 ./def %#Pl_236_3158064_240_5789784_NONE# %#Pl_250_12369084_240_5789784_NONE#3 ./%#Pl_231_16777215_240_5789784_bold#ghi %#Pl_240_5789784_236_3158064_NONE# %#Pl_231_16777215_236_3158064_NONE#                                         %#Pl_252_13684944_236_3158064_NONE# %#Pl_235_2500134_252_13684944_bold# Bufs '
	call writefile(['Unexpected tabline (3)', result], 'message.fail')
	cquit
endif

redir END
if g:messages =~ '\S'
	call writefile(['Non-empty messages:', g:messages], 'message.fail')
	cquit
endif

qall!