comparison src/testdir/test_gui.vim @ 10972:488cda29455b v8.0.0375

patch 8.0.0375: the "+ register is not tested commit https://github.com/vim/vim/commit/5074a0e0333eaa6a9f697eb765124ca0e244c89b Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 26 15:08:21 2017 +0100 patch 8.0.0375: the "+ register is not tested Problem: The "+ register is not tested. Solution: Add a test using another Vim instance to change the "+ register. (Kazuki Kuriyama)
author Christian Brabandt <cb@256bit.org>
date Sun, 26 Feb 2017 15:15:04 +0100
parents 4e2cdce4576c
children b3601a8eb679
comparison
equal deleted inserted replaced
10971:a53e4f26c2a2 10972:488cda29455b
63 " 'expected' is DFLT_FONT of gui_x11.c. 63 " 'expected' is DFLT_FONT of gui_x11.c.
64 call assert_equal('7x13', fname) 64 call assert_equal('7x13', fname)
65 elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') 65 elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
66 " 'expected' is DEFAULT_FONT of gui_gtk_x11.c. 66 " 'expected' is DEFAULT_FONT of gui_gtk_x11.c.
67 call assert_equal('Monospace 10', fname) 67 call assert_equal('Monospace 10', fname)
68 endif
69
70 if !empty(skipped)
71 throw skipped
72 endif
73 endfunc
74
75 func Test_quoteplus()
76 let skipped = ''
77
78 if !g:x11_based_gui
79 let skipped = g:not_supported . 'quoteplus'
80 else
81 let quoteplus_saved = @+
82
83 let test_call = 'Can you hear me?'
84 let test_response = 'Yes, I can.'
85 let vim_exe = exepath(v:progpath)
86 let testee = 'VIMRUNTIME=' . $VIMRUNTIME . '; export VIMRUNTIME;'
87 \ . vim_exe . ' -f -g -u NONE -U NONE --noplugin -c ''%s'''
88 let cmd = 'call feedkeys("'
89 \ . '\"+p'
90 \ . ':s/' . test_call . '/' . test_response . '/\<CR>'
91 \ . '\"+yis'
92 \ . ':q!\<CR>", "tx")'
93 let run_vimtest = printf(testee, cmd)
94
95 " Set the quoteplus register to test_call, and another gvim will launched.
96 " Then, it first tries to paste the content of its own quotedplus register
97 " onto it. Second, it tries to substitute test_responce for the pasted
98 " sentence. If the sentence is identical to test_call, the substitution
99 " should succeed. Third, it tries to yank the result of the substitution
100 " to its own quoteplus register, and last it quits. When system()
101 " returns, the content of the quoteplus register should be identical to
102 " test_response if those quoteplus registers are synchronized properly
103 " with/through the X11 clipboard.
104 let @+ = test_call
105 call system(run_vimtest)
106 call assert_equal(test_response, @+)
107
108 let @+ = quoteplus_saved
68 endif 109 endif
69 110
70 if !empty(skipped) 111 if !empty(skipped)
71 throw skipped 112 throw skipped
72 endif 113 endif