view src/testdir/test_popupwin_textprop.vim @ 17865:eaf8b21d80e7 v8.1.1929

patch 8.1.1929: no tests for text property popup window Commit: https://github.com/vim/vim/commit/8e95636a282f3eac808c0e00c053b33334cc283e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 25 23:08:17 2019 +0200 patch 8.1.1929: no tests for text property popup window Problem: No tests for text property popup window. Solution: Add a few tests.
author Bram Moolenaar <Bram@vim.org>
date Sun, 25 Aug 2019 23:15:03 +0200
parents
children f13a5c48320b
line wrap: on
line source

" Tests for popup windows for text properties

source check.vim
CheckFeature textprop

source screendump.vim
CheckScreendump

func Test_textprop_popup()
  let lines =<< trim END
	call setline(1, range(1, 100))
	call setline(50, 'some text to work with')
	50
	normal zz
	set scrolloff=0
	call prop_type_add('popupMarker', #{highlight: 'DiffAdd'})
	call prop_add(50, 11, #{
		\ length: 7,
		\ type: 'popupMarker',
		\ })
	let winid = popup_create('the text', #{
	      \ pos: 'botleft', 
	      \ textprop: 'popupMarker',
	      \ border: [],
	      \ padding: [0,1,0,1],
	      \ close: 'click',
	      \ })
  END
  call writefile(lines, 'XtestTextpropPopup')
  let buf = RunVimInTerminal('-S XtestTextpropPopup', #{rows: 10})
  call VerifyScreenDump(buf, 'Test_popup_textprop_01', {})

  call term_sendkeys(buf, "zt")
  call VerifyScreenDump(buf, 'Test_popup_textprop_02', {})

  call term_sendkeys(buf, "zzIawe\<Esc>")
  call VerifyScreenDump(buf, 'Test_popup_textprop_03', {})

  call term_sendkeys(buf, "0dw")
  call VerifyScreenDump(buf, 'Test_popup_textprop_04', {})

  call term_sendkeys(buf, "Oinserted\<Esc>")
  call VerifyScreenDump(buf, 'Test_popup_textprop_05', {})

  call term_sendkeys(buf, "k2dd")
  call VerifyScreenDump(buf, 'Test_popup_textprop_06', {})

  " clean up
  call StopVimInTerminal(buf)
  call delete('XtestTextpropPopup')
endfunc


" vim: shiftwidth=2 sts=2