comparison 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
comparison
equal deleted inserted replaced
29969:5f2d38cacd6c 29970:d891115c0aea
1398 call assert_equal('a.py', bufname(winbufnr(1))) 1398 call assert_equal('a.py', bufname(winbufnr(1)))
1399 %bw! 1399 %bw!
1400 %argdelete 1400 %argdelete
1401 " pressing shift when dropping files should change directory 1401 " pressing shift when dropping files should change directory
1402 let save_cwd = getcwd() 1402 let save_cwd = getcwd()
1403 call mkdir('Xdir1') 1403 call mkdir('Xdropdir1')
1404 call writefile([], 'Xdir1/Xfile1') 1404 call writefile([], 'Xdropdir1/Xfile1')
1405 call writefile([], 'Xdir1/Xfile2') 1405 call writefile([], 'Xdropdir1/Xfile2')
1406 let d = #{files: ['Xdir1/Xfile1', 'Xdir1/Xfile2'], row: 1, col: 1, 1406 let d = #{files: ['Xdropdir1/Xfile1', 'Xdropdir1/Xfile2'], row: 1, col: 1,
1407 \ modifiers: 0x4} 1407 \ modifiers: 0x4}
1408 call test_gui_event('dropfiles', d) 1408 call test_gui_event('dropfiles', d)
1409 call assert_equal('Xdir1', fnamemodify(getcwd(), ':t')) 1409 call assert_equal('Xdropdir1', fnamemodify(getcwd(), ':t'))
1410 call assert_equal('Xfile1', @%) 1410 call assert_equal('Xfile1', @%)
1411 call chdir(save_cwd) 1411 call chdir(save_cwd)
1412 " pressing shift when dropping directory and files should change directory 1412 " pressing shift when dropping directory and files should change directory
1413 let d = #{files: ['Xdir1', 'Xdir1/Xfile2'], row: 1, col: 1, modifiers: 0x4} 1413 let d = #{files: ['Xdropdir1', 'Xdropdir1/Xfile2'], row: 1, col: 1, modifiers: 0x4}
1414 call test_gui_event('dropfiles', d) 1414 call test_gui_event('dropfiles', d)
1415 call assert_equal('Xdir1', fnamemodify(getcwd(), ':t')) 1415 call assert_equal('Xdropdir1', fnamemodify(getcwd(), ':t'))
1416 call assert_equal('Xdir1', fnamemodify(@%, ':t')) 1416 call assert_equal('Xdropdir1', fnamemodify(@%, ':t'))
1417 call chdir(save_cwd) 1417 call chdir(save_cwd)
1418 %bw! 1418 %bw!
1419 %argdelete 1419 %argdelete
1420 " dropping a directory should edit it 1420 " dropping a directory should edit it
1421 let d = #{files: ['Xdir1'], row: 1, col: 1, modifiers: 0} 1421 let d = #{files: ['Xdropdir1'], row: 1, col: 1, modifiers: 0}
1422 call test_gui_event('dropfiles', d) 1422 call test_gui_event('dropfiles', d)
1423 call assert_equal('Xdir1', @%) 1423 call assert_equal('Xdropdir1', @%)
1424 %bw! 1424 %bw!
1425 %argdelete 1425 %argdelete
1426 " dropping only a directory name with Shift should ignore it 1426 " dropping only a directory name with Shift should ignore it
1427 let d = #{files: ['Xdir1'], row: 1, col: 1, modifiers: 0x4} 1427 let d = #{files: ['Xdropdir1'], row: 1, col: 1, modifiers: 0x4}
1428 call test_gui_event('dropfiles', d) 1428 call test_gui_event('dropfiles', d)
1429 call assert_equal('', @%) 1429 call assert_equal('', @%)
1430 %bw! 1430 %bw!
1431 %argdelete 1431 %argdelete
1432 call delete('Xdir1', 'rf') 1432 call delete('Xdropdir1', 'rf')
1433 1433
1434 " drop files in the command line. The GUI drop files adds the file names to 1434 " drop files in the command line. The GUI drop files adds the file names to
1435 " the low level input buffer. So need to use a cmdline map and feedkeys() 1435 " the low level input buffer. So need to use a cmdline map and feedkeys()
1436 " with 'Lx!' to process it in this function itself. 1436 " with 'Lx!' to process it in this function itself.
1437 " This sometimes fails, e.g. when using valgrind. 1437 " This sometimes fails, e.g. when using valgrind.