@@ -242,6 +242,11 @@ func Test_confirm_cmd()
242242 call assert_equal ([' foo4' ], readfile (' foo' ))
243243 call assert_equal ([' bar2' ], readfile (' bar' ))
244244
245+ call delete (' foo' )
246+ call delete (' bar' )
247+ endfunc
248+
249+ func Test_confirm_cmd_cancel ()
245250 " Test for closing a window with a modified buffer
246251 let buf = RunVimInTerminal (' ' , {' rows' : 20 })
247252 call term_sendkeys (buf , " :set nomore\n " )
@@ -251,14 +256,12 @@ func Test_confirm_cmd()
251256 call WaitForAssert ({- > assert_match (' ^\[Y\]es, (N)o, (C)ancel: *$' ,
252257 \ term_getline (buf , 20 ))}, 1000 )
253258 call term_sendkeys (buf , " C" )
259+ call term_wait (buf , 50 )
254260 call term_sendkeys (buf , " :confirm close\n " )
255261 call WaitForAssert ({- > assert_match (' ^\[Y\]es, (N)o, (C)ancel: *$' ,
256262 \ term_getline (buf , 20 ))}, 1000 )
257263 call term_sendkeys (buf , " N" )
258264 call StopVimInTerminal (buf )
259-
260- call delete (' foo' )
261- call delete (' bar' )
262265endfunc
263266
264267" Test for the :print command
0 commit comments