summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-02-26 15:08:21 +0100
committerBram Moolenaar <Bram@vim.org>2017-02-26 15:08:21 +0100
commit5074a0e0333eaa6a9f697eb765124ca0e244c89b (patch)
tree0371423eb8f6f1bc13833f55392070e47e862b26
parentba748c8a847561c043a63827bcb1d98bdebe16e6 (diff)
patch 8.0.0375: the "+ register is not testedv8.0.0375
Problem: The "+ register is not tested. Solution: Add a test using another Vim instance to change the "+ register. (Kazuki Kuriyama)
-rw-r--r--src/testdir/test_gui.vim41
-rw-r--r--src/version.c2
2 files changed, 43 insertions, 0 deletions
diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index d9430747de..77e4f2e9a6 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -72,6 +72,47 @@ func Test_getfontname_without_arg()
endif
endfunc
+func Test_quoteplus()
+ let skipped = ''
+
+ if !g:x11_based_gui
+ let skipped = g:not_supported . 'quoteplus'
+ else
+ let quoteplus_saved = @+
+
+ let test_call = 'Can you hear me?'
+ let test_response = 'Yes, I can.'
+ let vim_exe = exepath(v:progpath)
+ let testee = 'VIMRUNTIME=' . $VIMRUNTIME . '; export VIMRUNTIME;'
+ \ . vim_exe . ' -f -g -u NONE -U NONE --noplugin -c ''%s'''
+ let cmd = 'call feedkeys("'
+ \ . '\"+p'
+ \ . ':s/' . test_call . '/' . test_response . '/\<CR>'
+ \ . '\"+yis'
+ \ . ':q!\<CR>", "tx")'
+ let run_vimtest = printf(testee, cmd)
+
+ " Set the quoteplus register to test_call, and another gvim will launched.
+ " Then, it first tries to paste the content of its own quotedplus register
+ " onto it. Second, it tries to substitute test_responce for the pasted
+ " sentence. If the sentence is identical to test_call, the substitution
+ " should succeed. Third, it tries to yank the result of the substitution
+ " to its own quoteplus register, and last it quits. When system()
+ " returns, the content of the quoteplus register should be identical to
+ " test_response if those quoteplus registers are synchronized properly
+ " with/through the X11 clipboard.
+ let @+ = test_call
+ call system(run_vimtest)
+ call assert_equal(test_response, @+)
+
+ let @+ = quoteplus_saved
+ endif
+
+ if !empty(skipped)
+ throw skipped
+ endif
+endfunc
+
func Test_set_guifont()
let skipped = ''
diff --git a/src/version.c b/src/version.c
index b96daff1cb..58ece754d1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 375,
+/**/
374,
/**/
373,