mirror of
https://github.com/junegunn/limelight.vim.git
synced 2025-11-13 13:33:48 -05:00
Update test code
This commit is contained in:
@@ -1,107 +1,127 @@
|
|||||||
Execute (Setup):
|
Execute (Setup):
|
||||||
|
Save g:colors_name, &background
|
||||||
colo seoul256
|
colo seoul256
|
||||||
|
|
||||||
|
function! s:assert_on()
|
||||||
|
Assert exists('#limelight'), 'limelight should be on'
|
||||||
|
endfunction
|
||||||
|
function! s:assert_off()
|
||||||
|
Assert !exists('#limelight'), 'limelight should be off'
|
||||||
|
endfunction
|
||||||
|
command! AssertOn call s:assert_on()
|
||||||
|
command! AssertOff call s:assert_off()
|
||||||
|
|
||||||
Before:
|
Before:
|
||||||
unlet! g:limelight_default_coefficient
|
unlet! g:limelight_default_coefficient
|
||||||
\ g:limelight_conceal_guifg g:limelight_conceal_ctermfg
|
\ g:limelight_conceal_guifg g:limelight_conceal_ctermfg
|
||||||
|
|
||||||
Execute (Invalid argument type):
|
Execute (Invalid argument type):
|
||||||
Limelight 'hello'
|
Limelight 'hello'
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight {}
|
Limelight {}
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight []
|
Limelight []
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Execute (Invalid argument range):
|
Execute (Invalid argument range):
|
||||||
Limelight 1.2
|
Limelight 1.2
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight 2
|
Limelight 2
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight -0.2
|
Limelight -0.2
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight -1
|
Limelight -1
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Execute (Limelight / Limelight!):
|
Execute (Limelight / Limelight!):
|
||||||
Limelight
|
Limelight
|
||||||
Assert exists('#limelight')
|
AssertOn
|
||||||
|
|
||||||
Limelight
|
Limelight
|
||||||
Assert exists('#limelight')
|
AssertOn
|
||||||
|
|
||||||
Limelight!
|
Limelight!
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight!
|
Limelight!
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight 0.5
|
Limelight 0.5
|
||||||
Assert exists('#limelight')
|
AssertOn
|
||||||
|
|
||||||
Limelight!
|
Limelight!
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Execute (Limelight!!):
|
Execute (Limelight!!):
|
||||||
Limelight!!
|
Limelight!!
|
||||||
Assert exists('#limelight')
|
AssertOn
|
||||||
|
|
||||||
Limelight!!
|
Limelight!!
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight!! 2.0
|
Limelight!! 2.0
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Limelight!! 0.9
|
Limelight!! 0.9
|
||||||
Assert exists('#limelight')
|
AssertOn
|
||||||
|
|
||||||
Limelight!! 0.9
|
Limelight!! 0.9
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Execute (g:limelight_default_coefficient):
|
Execute (g:limelight_default_coefficient):
|
||||||
let g:limelight_default_coefficient = 2.0
|
let g:limelight_default_coefficient = 2.0
|
||||||
Limelight
|
Limelight
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
let g:limelight_default_coefficient = -1.0
|
let g:limelight_default_coefficient = -1.0
|
||||||
Limelight
|
Limelight
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Execute (Unsupported terminal):
|
Execute (Unsupported terminal):
|
||||||
colo default
|
colo default
|
||||||
let &t_Co = 16
|
let &t_Co = 16
|
||||||
|
|
||||||
Limelight
|
Limelight
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
Execute (Unsupported. but g:limelight_conceal_???fg defined):
|
Execute (Unsupported. but g:limelight_conceal_???fg defined):
|
||||||
if has('gui_running')
|
if has('gui_running')
|
||||||
colo default
|
colo default
|
||||||
let g:limelight_conceal_guifg = '#cccccc'
|
let g:limelight_conceal_guifg = '#cccccc'
|
||||||
Limelight
|
Limelight
|
||||||
Assert exists('#limelight')
|
AssertOn
|
||||||
Limelight!
|
Limelight!
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
else
|
else
|
||||||
colo default
|
colo default
|
||||||
let &t_Co = 256
|
let &t_Co = 256
|
||||||
let g:limelight_conceal_ctermfg = 240
|
let g:limelight_conceal_ctermfg = 240
|
||||||
|
|
||||||
Limelight
|
Limelight
|
||||||
Assert exists('#limelight')
|
AssertOn
|
||||||
Limelight!
|
Limelight!
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
let g:limelight_conceal_ctermfg = 'red'
|
let g:limelight_conceal_ctermfg = 'red'
|
||||||
|
Limelight
|
||||||
|
AssertOn
|
||||||
|
Limelight!
|
||||||
|
AssertOff
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" However, you're still not allowed to pass argument to Limelight command
|
" However, you're still not allowed to pass argument to Limelight command
|
||||||
Limelight 0.5
|
Limelight 0.5
|
||||||
Assert !exists('#limelight')
|
AssertOff
|
||||||
|
|
||||||
|
Execute (TODO: Color interpolation):
|
||||||
|
Assert 0, 'TODO'
|
||||||
|
|
||||||
|
Execute (Cleanup):
|
||||||
|
delc AssertOn
|
||||||
|
delc AssertOff
|
||||||
|
Restore
|
||||||
|
execute 'colo '.g:colors_name
|
||||||
|
|||||||
Reference in New Issue
Block a user