From fa2533c8bb96abcec29b9dc6bd4fe7054c7c7e50 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 5 Dec 2022 20:58:04 +0000 Subject: [PATCH] patch 9.0.1012: tests may get stuck in buffer with swap file Problem: Tests may get stuck in buffer with swap file. Solution: Bail out when bwipe! doesn't get another buffer. --- src/testdir/runtest.vim | 9 ++++++++- src/version.c | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index 6c42616c5..93acf9958 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -368,7 +368,14 @@ func RunTheTest(test) " buffer, continue until we end up in an empty no-name buffer without a swap " file. while bufname() != '' || execute('swapname') !~ 'No swap file' - bwipe! + let bn = bufnr() + + noswapfile bwipe! + + if bn == bufnr() + " avoid getting stuck in the same buffer + break + endif endwhile " Check if the test has left any swap files behind. Delete them before diff --git a/src/version.c b/src/version.c index 48bec3d9a..99f8b66f1 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1012, /**/ 1011, /**/ -- 2.40.0