source screendump.vim
func Test_simple_popup()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, range(1, 100))
hi PopupColor1 ctermbg=lightblue
endfunc
func Test_popup_with_border_and_padding()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
for iter in range(0, 1)
let lines =<< trim END
endfunc
func Test_popup_with_syntax_win_execute()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, range(1, 100))
hi PopupColor ctermbg=lightblue
endfunc
func Test_popup_with_syntax_setbufvar()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, range(1, 100))
hi PopupColor ctermbg=lightgrey
endfunc
func Test_popup_with_matches()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, ['111 222 333', '444 555 666'])
let winid = popup_create([
endfunc
func Test_popup_all_corners()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, repeat([repeat('-', 60)], 15))
set so=0
endfunc
func Test_popup_firstline()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, range(1, 20))
call popup_create(['1111', '222222', '33333', '44', '5', '666666', '77777', '888', '9999999999999999'], #{
endfunc
func Test_popup_drag()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
" create a popup that covers the command line
let lines =<< trim END
call setline(1, range(1, 20))
endfunc
func Test_popup_close_with_mouse()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, range(1, 20))
" With border, can click on X
endfunction
func Test_popup_with_mask()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, repeat([join(range(1, 42), '')], 13))
hi PopupColor ctermbg=lightgrey
endfunc
func Test_popup_select()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
- if !has('clipboard')
- throw 'Skipped: clipboard feature missing'
- endif
+ CheckScreendump
+ CheckFeature clipboard_working
+
" create a popup with some text to be selected
let lines =<< trim END
set clipboard=autoselect
endfunc
func Test_popup_with_wrap()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, range(1, 100))
let winid = popup_create(
endfunc
func Test_popup_without_wrap()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
call setline(1, range(1, 100))
let winid = popup_create(
endfunc
func Test_popup_with_showbreak()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
let lines =<< trim END
set showbreak=>>\
call setline(1, range(1, 20))
endfunc
func Test_popup_time()
- if !has('timers')
- throw 'Skipped: timer feature not supported'
- endif
+ CheckFeature timers
+
topleft vnew
call setline(1, 'hello')
endfunc
func Test_popup_beval()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let lines =<< trim END
call setline(1, range(1, 20))
endfunc
func Test_popup_menu_screenshot()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let lines =<< trim END
call setline(1, range(1, 20))
endfunc
func Test_popup_menu_narrow()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let lines =<< trim END
call setline(1, range(1, 20))
endfunc
func Test_popup_title()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
" Create a popup without title or border, a line of padding will be added to
" put the title on.
endfunc
func Test_popup_never_behind()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
" +-----------------------------+
" | | |
" | | |
endfunc
func Test_notifications()
- if !has('timers')
- throw 'Skipped: timer feature not supported'
- endif
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckFeature timers
+ CheckScreendump
call writefile([
\ "call setline(1, range(1, 20))",
endfunc
func Test_popup_scrollbar()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let lines =<< trim END
call setline(1, range(1, 20))
endfunc
func Test_popup_settext()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let lines =<< trim END
let opts = #{wrap: 0}
endfunc
func Test_popup_menu_with_maxwidth()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let lines =<< trim END
call setline(1, range(1, 10))
endfunc
func Test_popup_menu_with_scrollbar()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let lines =<< trim END
call setline(1, range(1, 20))
endfunc
func Test_popup_menu_filter()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let lines =<< trim END
function! MyFilter(winid, key) abort
endfunc
func Test_popup_cursorline()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
let winid = popup_create('some text', {})
call assert_equal(0, popup_getoptions(winid).cursorline)
endfunc
func Test_previewpopup()
- if !CanRunVimInTerminal()
- throw 'Skipped: cannot make screendumps'
- endif
+ CheckScreendump
+
call writefile([
\ "!_TAG_FILE_ENCODING\tutf-8\t//",
\ "another\tXtagfile\t/^this is another",
\ 'very long line where the word is also another'])
set previewpopup=height:4,width:40
set path=.
- call ch_logfile('logfile', 'w')
- call ch_log('logfile started')
END
call writefile(lines, 'XtestPreviewPopup')
let buf = RunVimInTerminal('-S XtestPreviewPopup', #{rows: 14})