diff src/testdir/test_paste.vim @ 16608:0422b14bce58 v8.1.1307

patch 8.1.1307: cannot reconnect to the X server after it restarted commit https://github.com/vim/vim/commit/d4aa83af1d691fdabbc8e6aab36db2c96ea4d4b6 Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 9 18:59:31 2019 +0200 patch 8.1.1307: cannot reconnect to the X server after it restarted Problem: Cannot reconnect to the X server after it restarted. Solution: Add the :xrestore command. (Adrian Kocis, closes https://github.com/vim/vim/issues/844)
author Bram Moolenaar <Bram@vim.org>
date Thu, 09 May 2019 19:00:08 +0200
parents fa133cd14f87
children f38fcbf343ce
line wrap: on
line diff
--- a/src/testdir/test_paste.vim
+++ b/src/testdir/test_paste.vim
@@ -110,3 +110,29 @@ func Test_paste_visual_mode()
 
   bwipe!
 endfunc
+
+func CheckCopyPaste()
+  call setline(1, ['copy this', ''])
+  normal 1G0"*y$
+  normal j"*p
+  call assert_equal('copy this', getline(2))
+endfunc
+
+func Test_xrestore()
+  if !has('xterm_clipboard')
+    return
+  endif
+call ch_logfile('logfile', 'w')
+  let display = $DISPLAY
+  new
+  call CheckCopyPaste()
+
+  xrestore
+  call CheckCopyPaste()
+
+  exe "xrestore " .. display
+  call CheckCopyPaste()
+
+call ch_logfile('', '')
+  bwipe!
+endfunc