Navigation Menu

Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Nov 27, 2014
1 parent ec6516c commit c082eb6
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 122 deletions.
32 changes: 32 additions & 0 deletions test/commands.vim
@@ -0,0 +1,32 @@
let s:suite = themis#suite('parser')
let s:assert = themis#helper('assert')

function! s:suite.internal()
VimShellCreate

let $FOO = ''
call vimshell#execute('export FOO=foo')
call s:assert.equals($FOO, 'foo')

" It contains space
let $FOO = ''
call vimshell#execute('export FOO="foo bar"')
call s:assert.equals($FOO, 'foo bar')

let $FOO = ''
let $BAR = ''
call vimshell#execute('export FOO="foo" BAR="bar"')
call s:assert.equals($FOO, 'foo')
call s:assert.equals($BAR, 'bar')

" Error pattern
let $FOO = ''
let $BAR = ''
call vimshell#execute('export FOO = "foo" BAR="bar"')
call s:assert.equals($FOO, '')
call s:assert.equals($BAR, '')

VimShellCreate -toggle
endfunction

" vim:foldmethod=marker:fen:
26 changes: 26 additions & 0 deletions test/config.vim
@@ -0,0 +1,26 @@
let s:suite = themis#suite('parser')
let s:assert = themis#helper('assert')

function! s:suite.prompt()
let g:vimshell_prompt = "'% ' "
let g:vimshell_secondary_prompt = 'aaa '
VimShellCreate -toggle
call s:assert.equals(vimshell#get_prompt(), "'% ' ")
call s:assert.equals(vimshell#get_secondary_prompt(), 'aaa ')
VimShellCreate -toggle

let g:vimshell_user_prompt = 'fnamemodify(getcwd(), ":~")'
VimShellCreate -toggle
call s:assert.equals(vimshell#get_user_prompt(),
\ 'fnamemodify(getcwd(), ":~")')
VimShellCreate -toggle
let g:vimshell_user_prompt = ""
endfunction

function! s:suite.options()
VimShellCreate -toggle -prompt=foo\ bar
call s:assert.equals(vimshell#get_prompt(), 'foo bar')
VimShellCreate -toggle
endfunction

" vim:foldmethod=marker:fen:
19 changes: 19 additions & 0 deletions test/parser.vim
@@ -0,0 +1,19 @@
let s:suite = themis#suite('parser')
let s:assert = themis#helper('assert')

function! s:suite.alias()
VimShellCreate
call vimshell#set_alias('l2', 'll')
call vimshell#set_alias('ll', 'ls -l')
call s:assert.equals(
\ vimshell#parser#parse_alias('l2'), 'ls -l')
VimShellCreate -toggle
endfunction

function! s:suite.getopt()
call s:assert.equals(vimshell#parser#getopt(['foo', 'bar'], {
\ 'noarg' : ['--insert'],
\ }), [['foo', 'bar'], {}])
endfunction

" vim:foldmethod=marker:fen:
46 changes: 0 additions & 46 deletions vest/commands.vim

This file was deleted.

44 changes: 0 additions & 44 deletions vest/config.vim

This file was deleted.

32 changes: 0 additions & 32 deletions vest/parser.vim

This file was deleted.

0 comments on commit c082eb6

Please sign in to comment.