mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-07 20:54:26 +08:00
test creation of sections
This commit is contained in:
28
t/section.vim
Normal file
28
t/section.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
call airline#init#bootstrap()
|
||||
|
||||
function! SectionSpec()
|
||||
endfunction
|
||||
|
||||
describe 'section'
|
||||
before
|
||||
call airline#parts#define_text('text', 'text')
|
||||
call airline#parts#define_raw('raw', 'raw')
|
||||
call airline#parts#define_function('func', 'SectionSpec')
|
||||
end
|
||||
|
||||
it 'should create sections with no separators'
|
||||
let s = airline#section#create(['text', 'raw', 'func'])
|
||||
Expect s == '%{"text"}raw%{SectionSpec()}'
|
||||
end
|
||||
|
||||
it 'should create left sections with separators'
|
||||
let s = airline#section#create_left(['text', 'text'])
|
||||
Expect s == '%{"text"}%{airline#util#append("text")}'
|
||||
end
|
||||
|
||||
it 'should create right sections with separators'
|
||||
let s = airline#section#create_right(['text', 'text'])
|
||||
Expect s == '%{airline#util#prepend("text")}%{"text"}'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user