" Tests for various functions.
source shared.vim
" Must be done first, since the alternate buffer must be unset.
func Test_00_bufexists()
call assert_equal(0, bufexists('does_not_exist'))
call assert_equal(1, bufexists(bufnr('%')))
call assert_equal(0, bufexists(0))
new Xfoo
let bn = bufnr('%')
call assert_equal(1, bufexists(bn))
call assert_equal(1, bufexists('Xfoo'))
call assert_equal(1, bufexists(getcwd() . '/Xfoo'))
call assert_equal(1, bufexists(0))
bw
call assert_equal(0, bufexists(bn))
call assert_equal(0, bufexists('Xfoo'))
endfunc
func Test_empty()
call assert_equal(1, empty(''))
call assert_equal(0, empty('a'))
call assert_equal(1, empty(0))
call assert_equal(1, empty(-0))
call assert_equal(0, empty(1))
call assert_equal(0, empty(-1))
call assert_equal(