]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.5111: no test for --gui-dialog-file v8.2.5111
authorBram Moolenaar <Bram@vim.org>
Thu, 16 Jun 2022 13:45:41 +0000 (14:45 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 16 Jun 2022 13:45:41 +0000 (14:45 +0100)
Problem:    No test for --gui-dialog-file.
Solution:   Add a test.

src/testdir/test_gui.vim
src/version.c

index 96fed7c1fd0a599ca0c5ecc6e60984229fc772f2..954cf2a0660c2f4005782a7b39ef5aaa6a349795 100644 (file)
@@ -118,9 +118,8 @@ func Test_quoteplus()
 
   let test_call     = 'Can you hear me?'
   let test_response = 'Yes, I can.'
-  let vim_exe = GetVimCommand()
-  let testee = 'VIMRUNTIME=' . $VIMRUNTIME . '; export VIMRUNTIME;'
-        \ . vim_exe . ' --noplugin --not-a-term -c ''%s'''
+  let testee = 'VIMRUNTIME=' .. $VIMRUNTIME .. '; export VIMRUNTIME;'
+        \ .. GetVimCommand() .. ' --noplugin --not-a-term -c ''%s'''
   " Ignore the "failed to create input context" error.
   let cmd = 'call test_ignore_error("E285") | '
         \ . 'gui -f | '
@@ -1588,4 +1587,21 @@ func Test_gui_CTRL_SHIFT_V()
   unlet g:str
 endfunc
 
+func Test_gui_dialog_file()
+  let lines =<< trim END
+    file Xfile
+    normal axxx
+    confirm qa
+  END
+  call writefile(lines, 'Xlines')
+  execute '!' .. GetVimCommand() .. ' -g -f --clean --gui-dialog-file Xdialog -S Xlines'
+
+  call WaitForAssert({-> assert_true(filereadable('Xdialog'))})
+  call assert_match('Question: Save changes to "Xfile"?', readfile('Xdialog')->join('<NL>'))
+
+  call delete('Xdialog')
+  call delete('Xfile')
+  call delete('Xlines')
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 1f38480d0de9a036d063f7b247a1790488cb5119..a438340d6e897e5ef7b2b31f924521d3074d4275 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5111,
 /**/
     5110,
 /**/