Mercurial > vim
diff src/testdir/test_gui.vim @ 29970:d891115c0aea v9.0.0323
patch 9.0.0323: using common name in tests leads to flaky tests
Commit: https://github.com/vim/vim/commit/3b0d70f4ff436cb144683dafd956e8a3ee485a90
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 29 22:31:20 2022 +0100
patch 9.0.0323: using common name in tests leads to flaky tests
Problem: Using common name in tests leads to flaky tests.
Solution: Rename files and directories to be more specific.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 Aug 2022 23:45:04 +0200 |
parents | 6d44e5e9e0ce |
children | b8abb8908801 |
line wrap: on
line diff
--- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -1400,36 +1400,36 @@ func Test_gui_drop_files() %argdelete " pressing shift when dropping files should change directory let save_cwd = getcwd() - call mkdir('Xdir1') - call writefile([], 'Xdir1/Xfile1') - call writefile([], 'Xdir1/Xfile2') - let d = #{files: ['Xdir1/Xfile1', 'Xdir1/Xfile2'], row: 1, col: 1, + call mkdir('Xdropdir1') + call writefile([], 'Xdropdir1/Xfile1') + call writefile([], 'Xdropdir1/Xfile2') + let d = #{files: ['Xdropdir1/Xfile1', 'Xdropdir1/Xfile2'], row: 1, col: 1, \ modifiers: 0x4} call test_gui_event('dropfiles', d) - call assert_equal('Xdir1', fnamemodify(getcwd(), ':t')) + call assert_equal('Xdropdir1', fnamemodify(getcwd(), ':t')) call assert_equal('Xfile1', @%) call chdir(save_cwd) " pressing shift when dropping directory and files should change directory - let d = #{files: ['Xdir1', 'Xdir1/Xfile2'], row: 1, col: 1, modifiers: 0x4} + let d = #{files: ['Xdropdir1', 'Xdropdir1/Xfile2'], row: 1, col: 1, modifiers: 0x4} call test_gui_event('dropfiles', d) - call assert_equal('Xdir1', fnamemodify(getcwd(), ':t')) - call assert_equal('Xdir1', fnamemodify(@%, ':t')) + call assert_equal('Xdropdir1', fnamemodify(getcwd(), ':t')) + call assert_equal('Xdropdir1', fnamemodify(@%, ':t')) call chdir(save_cwd) %bw! %argdelete " dropping a directory should edit it - let d = #{files: ['Xdir1'], row: 1, col: 1, modifiers: 0} + let d = #{files: ['Xdropdir1'], row: 1, col: 1, modifiers: 0} call test_gui_event('dropfiles', d) - call assert_equal('Xdir1', @%) + call assert_equal('Xdropdir1', @%) %bw! %argdelete " dropping only a directory name with Shift should ignore it - let d = #{files: ['Xdir1'], row: 1, col: 1, modifiers: 0x4} + let d = #{files: ['Xdropdir1'], row: 1, col: 1, modifiers: 0x4} call test_gui_event('dropfiles', d) call assert_equal('', @%) %bw! %argdelete - call delete('Xdir1', 'rf') + call delete('Xdropdir1', 'rf') " drop files in the command line. The GUI drop files adds the file names to " the low level input buffer. So need to use a cmdline map and feedkeys()