Mercurial > vim
changeset 29183:8f6b850bb8c3 v8.2.5111
patch 8.2.5111: no test for --gui-dialog-file
Commit: https://github.com/vim/vim/commit/de8be2beaeb99961247766a9b8181429be1617d6
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 16 14:45:41 2022 +0100
patch 8.2.5111: no test for --gui-dialog-file
Problem: No test for --gui-dialog-file.
Solution: Add a test.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 16 Jun 2022 16:00:03 +0200 |
parents | b6f9992965c7 |
children | 2e561df4e8ba |
files | src/testdir/test_gui.vim src/version.c |
diffstat | 2 files changed, 21 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -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