This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
repl.vim/test/variable.vim

50 lines
1.8 KiB
VimL
Raw Normal View History

let s:suite = themis#suite('variable')
let s:assert = themis#helper('assert')
2015-12-23 13:30:34 +00:00
let s:scope = themis#helper('scope')
function! s:suite.after_each()
2015-12-24 12:58:21 +00:00
call ResetVariables()
endfunction
"-------------------"
function! s:suite.g_repl_filetype_repl_is_valid()
let l:TARGET_FILETYPE = 'ruby' | lockvar l:TARGET_FILETYPE
" Default value
let l:DEFAULT_REPL_NAME = g:repl#default_filetype_repl[l:TARGET_FILETYPE]['repl'] | lockvar l:DEFAULT_REPL_NAME
let l:DEFAULT_REPL_OPT = g:repl#default_filetype_repl[l:TARGET_FILETYPE]['opt'] | lockvar l:DEFAULT_REPL_OPT
let l:filetype_repl = repl#get_filetype_repl(l:TARGET_FILETYPE)
call s:assert.equals(l:filetype_repl['repl'], l:DEFAULT_REPL_NAME)
call s:assert.equals(l:filetype_repl['opt'], l:DEFAULT_REPL_OPT)
" Not a default value
let l:REPL_NAME = 'dummy' | lockvar l:REPL_NAME
let l:REPL_OPT = '--dummy' | lockvar l:REPL_OPT
let g:repl_filetype_repl = {
\ l:TARGET_FILETYPE : {
\ 'repl' : l:REPL_NAME,
\ 'opt' : l:REPL_OPT
\ }
\}
let l:filetype_repl = repl#get_filetype_repl(l:TARGET_FILETYPE)
call s:assert.equals(l:filetype_repl['repl'], l:REPL_NAME)
call s:assert.equals(l:filetype_repl['opt'], l:REPL_OPT)
endfunction
2015-12-23 13:30:34 +00:00
"function! s:suite.g_repl_no_default_keymappings_is_valid_if_disabled()
" " Case: g:repl_no_default_keymappings is undefined
" let s:funcs = s:scope.funcs('plugin/repl.vim')
" call s:funcs.define_default_keymappings()
" call s:assert.true(hasmapto("\i", 'n'))
" nunmap <leader>i
"endfunction
"
"function! s:suite.g_repl_no_default_keymappings_is_valid_if_enabled()
" " Case: g:repl_no_default_keymappings is defined to 1
" let g:repl_no_default_keymappings = 1
" let s:funcs = s:scope.funcs('plugin/repl.vim')
" call s:funcs.define_default_keymappings()
" call s:assert.false(hasmapto("\i", 'n'))
"endfunction