diff src/testdir/test_popupwin.vim @ 17045:7fe328ad5573 v8.1.1522

patch 8.1.1522: poup_notification() not implemented yet commit https://github.com/vim/vim/commit/68d48f40a4da79547b53e3164b658812e154d411 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 12 22:42:41 2019 +0200 patch 8.1.1522: poup_notification() not implemented yet Problem: Popup_notification() not implemented yet. Solution: Implement it.
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Jun 2019 22:45:07 +0200
parents d99805d25b42
children 6400d1ad5e4b
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -428,7 +428,7 @@ endfunc
 
 func Test_popup_time()
   if !has('timers')
-    return
+    throw 'Skipped, timer feature not supported'
   endif
   topleft vnew
   call setline(1, 'hello')
@@ -1086,3 +1086,29 @@ func Test_popup_moved()
   bwipe!
   call test_override('ALL', 0)
 endfunc
+
+func Test_notifications()
+  if !has('timers')
+    throw 'Skipped, timer feature not supported'
+  endif
+  if !CanRunVimInTerminal()
+    throw 'Skipped: cannot make screendumps'
+  endif
+
+  call writefile([
+	\ "call setline(1, range(1, 20))",
+	\ "hi Notification ctermbg=lightblue",
+	\ "call popup_notification('first notification', {})",
+	\], 'XtestNotifications')
+  let buf = RunVimInTerminal('-S XtestNotifications', {'rows': 10})
+  call VerifyScreenDump(buf, 'Test_popupwin_notify_01', {})
+
+  " second one goes below the first one
+  call term_sendkeys(buf, ":call popup_notification('another important notification', {'highlight': 'Notification'})\<CR>")
+  call VerifyScreenDump(buf, 'Test_popupwin_notify_02', {})
+
+
+  " clean up
+  call StopVimInTerminal(buf)
+  call delete('XtestNotifications')
+endfunc