comparison src/testdir/test_clientserver.vim @ 29997:98f5a0618a77 v9.0.0336

patch 9.0.0336: tests are flaky because of using a common file name Commit: https://github.com/vim/vim/commit/61abe7d8f827ec31f098e8abcdf58846b956ef16 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 30 21:46:08 2022 +0100 patch 9.0.0336: tests are flaky because of using a common file name Problem: Tests are flaky because of using a common file name. Solution: Rename files and directories to be more unique.
author Bram Moolenaar <Bram@vim.org>
date Tue, 30 Aug 2022 23:00:05 +0200
parents 9849df834f1d
children 2fee2d1b498e
comparison
equal deleted inserted replaced
29996:e37754a13778 29997:98f5a0618a77
128 128
129 let cmd = GetVimProg() .. ' --servername ' .. name 129 let cmd = GetVimProg() .. ' --servername ' .. name
130 130
131 " Run a separate instance to send a command to the server 131 " Run a separate instance to send a command to the server
132 call remote_expr(name, 'execute("only")') 132 call remote_expr(name, 'execute("only")')
133 call system(cmd .. ' --remote-send ":new Xfile<CR>"') 133 call system(cmd .. ' --remote-send ":new Xclientfile<CR>"')
134 call assert_equal('2', remote_expr(name, 'winnr("$")')) 134 call assert_equal('2', remote_expr(name, 'winnr("$")'))
135 call assert_equal('Xfile', remote_expr(name, 'winbufnr(1)->bufname()')) 135 call assert_equal('Xclientfile', remote_expr(name, 'winbufnr(1)->bufname()'))
136 call remote_expr(name, 'execute("only")') 136 call remote_expr(name, 'execute("only")')
137 137
138 " Invoke a remote-expr. On MS-Windows, the returned value has a carriage 138 " Invoke a remote-expr. On MS-Windows, the returned value has a carriage
139 " return. 139 " return.
140 let l = system(cmd .. ' --remote-expr "2 + 2"') 140 let l = system(cmd .. ' --remote-expr "2 + 2"')
141 call assert_equal(['4'], split(l, "\n")) 141 call assert_equal(['4'], split(l, "\n"))
142 142
143 " Edit multiple files using --remote 143 " Edit multiple files using --remote
144 call system(cmd .. ' --remote Xfile1 Xfile2 Xfile3') 144 call system(cmd .. ' --remote Xclientfile1 Xclientfile2 Xclientfile3')
145 call assert_match(".*Xfile1\n.*Xfile2\n.*Xfile3\n", remote_expr(name, 'argv()')) 145 call assert_match(".*Xclientfile1\n.*Xclientfile2\n.*Xclientfile3\n", remote_expr(name, 'argv()'))
146 eval name->remote_send(":%bw!\<CR>") 146 eval name->remote_send(":%bw!\<CR>")
147 147
148 " Edit files in separate tab pages 148 " Edit files in separate tab pages
149 call system(cmd .. ' --remote-tab Xfile1 Xfile2 Xfile3') 149 call system(cmd .. ' --remote-tab Xclientfile1 Xclientfile2 Xclientfile3')
150 call WaitForAssert({-> assert_equal('3', remote_expr(name, 'tabpagenr("$")'))}) 150 call WaitForAssert({-> assert_equal('3', remote_expr(name, 'tabpagenr("$")'))})
151 call assert_match('.*\<Xfile2', remote_expr(name, 'bufname(tabpagebuflist(2)[0])')) 151 call assert_match('.*\<Xclientfile2', remote_expr(name, 'bufname(tabpagebuflist(2)[0])'))
152 eval name->remote_send(":%bw!\<CR>") 152 eval name->remote_send(":%bw!\<CR>")
153 153
154 " Edit a file using --remote-wait 154 " Edit a file using --remote-wait
155 eval name->remote_send(":source $VIMRUNTIME/plugin/rrhelper.vim\<CR>") 155 eval name->remote_send(":source $VIMRUNTIME/plugin/rrhelper.vim\<CR>")
156 call system(cmd .. ' --remote-wait +enew Xfile1') 156 call system(cmd .. ' --remote-wait +enew Xclientfile1')
157 call assert_match('.*\<Xfile1', remote_expr(name, 'bufname("#")')) 157 call assert_match('.*\<Xclientfile1', remote_expr(name, 'bufname("#")'))
158 eval name->remote_send(":%bw!\<CR>") 158 eval name->remote_send(":%bw!\<CR>")
159 159
160 " Edit files using --remote-tab-wait 160 " Edit files using --remote-tab-wait
161 call system(cmd .. ' --remote-tabwait +tabonly\|enew Xfile1 Xfile2') 161 call system(cmd .. ' --remote-tabwait +tabonly\|enew Xclientfile1 Xclientfile2')
162 call assert_equal('1', remote_expr(name, 'tabpagenr("$")')) 162 call assert_equal('1', remote_expr(name, 'tabpagenr("$")'))
163 eval name->remote_send(":%bw!\<CR>") 163 eval name->remote_send(":%bw!\<CR>")
164 164
165 " Error cases 165 " Error cases
166 if v:lang == "C" || v:lang =~ '^[Ee]n' 166 if v:lang == "C" || v:lang =~ '^[Ee]n'