|
| 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