Skip to content

Commit 5074a0e

Browse files
committed
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)
1 parent ba748c8 commit 5074a0e

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

src/testdir/test_gui.vim

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,47 @@ func Test_getfontname_without_arg()
7272
endif
7373
endfunc
7474

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
109+
endif
110+
111+
if !empty(skipped)
112+
throw skipped
113+
endif
114+
endfunc
115+
75116
func Test_set_guifont()
76117
let skipped = ''
77118

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
375,
767769
/**/
768770
374,
769771
/**/

0 commit comments

Comments
 (0)