comparison src/testdir/test_autocmd.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 c8b1a683323c
children b2140f61826c
comparison
equal deleted inserted replaced
29969:5f2d38cacd6c 29970:d891115c0aea
715 call assert_equal('+', g:val) 715 call assert_equal('+', g:val)
716 bwipe! 716 bwipe!
717 call assert_equal('++', g:val) 717 call assert_equal('++', g:val)
718 718
719 " Also get BufEnter when editing a directory 719 " Also get BufEnter when editing a directory
720 call mkdir('Xdir') 720 call mkdir('Xbufenterdir')
721 split Xdir 721 split Xbufenterdir
722 call assert_equal('+++', g:val) 722 call assert_equal('+++', g:val)
723 723
724 " On MS-Windows we can't edit the directory, make sure we wipe the right 724 " On MS-Windows we can't edit the directory, make sure we wipe the right
725 " buffer. 725 " buffer.
726 bwipe! Xdir 726 bwipe! Xbufenterdir
727 call delete('Xdir', 'd') 727 call delete('Xbufenterdir', 'd')
728 au! BufEnter 728 au! BufEnter
729 729
730 " Editing a "nofile" buffer doesn't read the file but does trigger BufEnter 730 " Editing a "nofile" buffer doesn't read the file but does trigger BufEnter
731 " for historic reasons. Also test other 'buftype' values. 731 " for historic reasons. Also test other 'buftype' values.
732 for val in ['nofile', 732 for val in ['nofile',
2721 bwipe! 2721 bwipe!
2722 au! throwing 2722 au! throwing
2723 endfunc 2723 endfunc
2724 2724
2725 func Test_autocmd_in_try_block() 2725 func Test_autocmd_in_try_block()
2726 call mkdir('Xdir') 2726 call mkdir('Xintrydir')
2727 au BufEnter * let g:fname = expand('%') 2727 au BufEnter * let g:fname = expand('%')
2728 try 2728 try
2729 edit Xdir/ 2729 edit Xintrydir/
2730 endtry 2730 endtry
2731 call assert_match('Xdir', g:fname) 2731 call assert_match('Xintrydir', g:fname)
2732 2732
2733 unlet g:fname 2733 unlet g:fname
2734 au! BufEnter 2734 au! BufEnter
2735 call delete('Xdir', 'rf') 2735 call delete('Xintrydir', 'rf')
2736 endfunc 2736 endfunc
2737 2737
2738 func Test_autocmd_SafeState() 2738 func Test_autocmd_SafeState()
2739 CheckRunVimInTerminal 2739 CheckRunVimInTerminal
2740 2740