Skip to content

Commit dc07a14

Browse files
authored
Merge pull request #943 from ychin/macvim-tests
Add MacVim test scripts for basic testing
2 parents 0b679a4 + 53f0d7e commit dc07a14

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

src/testdir/Make_all.mak

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ NEW_TESTS = \
172172
test_listlbr \
173173
test_listlbr_utf8 \
174174
test_lua \
175+
test_macvim \
175176
test_makeencoding \
176177
test_man \
177178
test_maparg \
@@ -372,6 +373,7 @@ NEW_TESTS_RES = \
372373
test_listener.res \
373374
test_listlbr.res \
374375
test_lua.res \
376+
test_macvim.res \
375377
test_makeencoding.res \
376378
test_man.res \
377379
test_maparg.res \

src/testdir/test_macvim.vim

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
" Test for MacVim behaviors and regressions
2+
3+
source check.vim
4+
CheckFeature gui_macvim
5+
6+
" Tests for basic existence of commands and options to make sure no
7+
" regressions have accidentally removed them
8+
func Test_macvim_options_commands()
9+
call assert_true(exists('+antialias'), 'Missing option "antialias"')
10+
call assert_true(exists('+blurradius'), 'Missing option "blurradius"')
11+
call assert_true(exists('+fullscreen'), 'Missing option "fullscreen"')
12+
call assert_true(exists('+fuoptions'), 'Missing option "fuoptions"')
13+
call assert_true(exists('+macligatures'), 'Missing option "macligatures"')
14+
call assert_true(exists('+macmeta'), 'Missing option "macmeta"')
15+
call assert_true(exists('+macthinstrokes'), 'Missing option "macthinstrokes"')
16+
call assert_true(exists('+toolbariconsize'), 'Missing option "toolbariconsize"')
17+
call assert_true(exists('+transparency'), 'Missing option "transparency"')
18+
19+
call assert_true(exists(':macaction'), 'Missing command "macaction"')
20+
call assert_true(exists(':macmenu'), 'Missing command "macmenu"')
21+
endfunc
22+
23+
" Test that Cmd-key and touch pad mappings are working (this doesn't actually
24+
" test that the full mapping work properly as it's difficult to inject keys in
25+
" Vimscript)
26+
func Test_macvim_mappings()
27+
let g:marker_value=0
28+
29+
nnoremap <D-1> :let g:marker_value=1<CR>
30+
call feedkeys("\<D-1>", "xt")
31+
call assert_equal(1, g:marker_value)
32+
33+
nnoremap <SwipeLeft> :let g:marker_value=1<CR>
34+
call feedkeys("\<SwipeLeft>", "xt")
35+
call assert_equal(1, g:marker_value)
36+
nnoremap <SwipeRight> :let g:marker_value=2<CR>
37+
call feedkeys("\<SwipeRight>", "xt")
38+
call assert_equal(2, g:marker_value)
39+
nnoremap <SwipeUp> :let g:marker_value=3<CR>
40+
call feedkeys("\<SwipeUp>", "xt")
41+
call assert_equal(3, g:marker_value)
42+
nnoremap <SwipeDown> :let g:marker_value=4<CR>
43+
call feedkeys("\<SwipeDown>", "xt")
44+
call assert_equal(4, g:marker_value)
45+
nnoremap <ForceClick> :let g:marker_value=5<CR>
46+
call feedkeys("\<ForceClick>", "xt")
47+
call assert_equal(5, g:marker_value)
48+
endfunc

0 commit comments

Comments
 (0)