Mercurial > vim
comparison src/testdir/test_window_cmd.vim @ 31343:97bb0811cfd4 v9.0.1005
patch 9.0.1005: a failed test may leave a swap file behind
Commit: https://github.com/vim/vim/commit/d0f8d39d20f8d42f7451f781f7be0bcd20e06741
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 4 23:00:41 2022 +0000
patch 9.0.1005: a failed test may leave a swap file behind
Problem: A failed test may leave a swap file behind.
Solution: Delete the swap file to avoid another test to fail. Use another
file name.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 05 Dec 2022 00:15:06 +0100 |
parents | a9040128bc3b |
children | 56a2af8c0980 |
comparison
equal
deleted
inserted
replaced
31342:60cf6899a082 | 31343:97bb0811cfd4 |
---|---|
135 bw | 135 bw |
136 endfunc | 136 endfunc |
137 | 137 |
138 " Test the ":wincmd ^" and "<C-W>^" commands. | 138 " Test the ":wincmd ^" and "<C-W>^" commands. |
139 func Test_window_split_edit_alternate() | 139 func Test_window_split_edit_alternate() |
140 " in case a previous failure left a swap file behind | |
141 call delete('.Xfoo.swp') | |
140 | 142 |
141 " Test for failure when the alternate buffer/file no longer exists. | 143 " Test for failure when the alternate buffer/file no longer exists. |
142 edit Xfoo | %bw | 144 edit Xfoo | %bw |
143 call assert_fails(':wincmd ^', 'E23:') | 145 call assert_fails(':wincmd ^', 'E23:') |
144 | 146 |
168 %bw! | 170 %bw! |
169 endfunc | 171 endfunc |
170 | 172 |
171 " Test the ":[count]wincmd ^" and "[count]<C-W>^" commands. | 173 " Test the ":[count]wincmd ^" and "[count]<C-W>^" commands. |
172 func Test_window_split_edit_bufnr() | 174 func Test_window_split_edit_bufnr() |
175 " in case a previous failure left a swap file behind | |
176 call delete('.Xfoo.swp') | |
173 | 177 |
174 %bwipeout | 178 %bwipeout |
175 let l:nr = bufnr('%') + 1 | 179 let l:nr = bufnr('%') + 1 |
176 call assert_fails(':execute "normal! ' . l:nr . '\<C-W>\<C-^>"', 'E92:') | 180 call assert_fails(':execute "normal! ' . l:nr . '\<C-W>\<C-^>"', 'E92:') |
177 call assert_fails(':' . l:nr . 'wincmd ^', 'E16:') | 181 call assert_fails(':' . l:nr . 'wincmd ^', 'E16:') |