@@ -72,6 +72,47 @@ func Test_getfontname_without_arg()
7272 endif
7373endfunc
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+
75116func Test_set_guifont ()
76117 let skipped = ' '
77118
0 commit comments