2020-12-07 11:35:03 -07:00
|
|
|
" Tests for Vim buffer
|
|
|
|
|
2021-02-13 11:41:30 -07:00
|
|
|
func Test_buffer_error()
|
|
|
|
new foo1
|
|
|
|
new foo2
|
|
|
|
|
|
|
|
call assert_fails('buffer foo', 'E93:')
|
|
|
|
call assert_fails('buffer bar', 'E94:')
|
|
|
|
call assert_fails('buffer 0', 'E939:')
|
|
|
|
|
|
|
|
%bwipe
|
|
|
|
endfunc
|
|
|
|
|
2021-02-13 11:34:43 -07:00
|
|
|
func Test_badd_options()
|
|
|
|
new SomeNewBuffer
|
2021-02-13 11:49:42 -07:00
|
|
|
setlocal numberwidth=3
|
2021-02-13 11:34:43 -07:00
|
|
|
wincmd p
|
|
|
|
badd SomeNewBuffer
|
|
|
|
new SomeNewBuffer
|
2021-02-13 11:49:42 -07:00
|
|
|
call assert_equal(3, &numberwidth)
|
2021-02-13 11:34:43 -07:00
|
|
|
close
|
|
|
|
close
|
|
|
|
bwipe! SomeNewBuffer
|
|
|
|
endfunc
|
|
|
|
|
2020-12-07 11:35:03 -07:00
|
|
|
func Test_balt()
|
|
|
|
new SomeNewBuffer
|
|
|
|
balt +3 OtherBuffer
|
|
|
|
e #
|
|
|
|
call assert_equal('OtherBuffer', bufname())
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
" vim: shiftwidth=2 sts=2 expandtab
|