]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0782: tests: missing cleanup in test_mksession.vim master v9.2.0782
authorIllia Bobyr <illia.bobyr@gmail.com>
Fri, 3 Jul 2026 16:24:57 +0000 (16:24 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 3 Jul 2026 16:24:57 +0000 (16:24 +0000)
commit834b8d218f1db92e587ecd449e5ce88b41fbe256
treeb16e7891952c66aa67810a0968586bc0eb92465c
parent5680e3b2946666e237f433756c1a54bcc7814475
patch 9.2.0782: tests: missing cleanup in test_mksession.vim

Problem:  Some test_mksession tests do not cleanup all the state
Solution: Add commands to clean up state introduced by the test
          (Illia Bobyr)

Before this change the following 4 tests were failing when executed
individually:

  Test_mksession_arglocal_localdir
  Test_mksession_buffer_count
  Test_mksession_one_buffer_two_windows
  Test_mksession_winminheight

As in
```
  TEST_FILTER=winminheight make test_mksession
```
Yet, when ran as part of the whole test suite they succeeded.

This was due to some state leaking from one test into another.

I think this is bad, as it can confuse someone making changes in the
relevant area.

`Test_mksession_winminheight` is actually still broken a bit, and
requires `winheight` and `winwidth` set at the beginning of the test,
rather than later, when it actually matters.  This exposes a subtle bug
in the session restore script.  I have a patch in a separate commit.

closes: #20691

Signed-off-by: Illia Bobyr <illia.bobyr@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_mksession.vim
src/version.c