]> git.eshelyaron.com Git - emacs.git/commit
Rewrite the `kill-buffer-delete-auto-save' tests (bug#59028)
authorMatt Armstrong <matt@rfc20.org>
Fri, 4 Nov 2022 19:43:30 +0000 (12:43 -0700)
committerEli Zaretskii <eliz@gnu.org>
Thu, 10 Nov 2022 09:53:46 +0000 (11:53 +0200)
commitb4db61f5804b16f66acf1a824944b4ef1e32186d
tree8d70b4def1c2e3e3483dae879aced4fb87568120
parentabbb0faceaedea5369eba68c43e0b19dc861810f
Rewrite the `kill-buffer-delete-auto-save' tests (bug#59028)

These tests had been annoying to me when run in interactive mode.
They failed to bind `kill-buffer-delete-auto-save' as needed, so they
depended on the user's settings, and they failed to mock out the
"Buffer modified, save?" prompt.

* test/src/buffer-tests.el (test-kill-buffer-auto-save): New helper
function that mocks the two different kinds of prompts that occur when
killing modified buffers that visit a file.  Tests fail if expected
prompts are not issued.
(test-kill-buffer-auto-save-default): Use it, and explicitly bind
`kill-buffer-delete-auto-save' to nil.
(test-kill-buffer-auto-save-delete): Delete it.
(test-kill-buffer-auto-save-delete-yes): New test for the "yes" half
of the old `test-kill-buffer-auto-save-delete'.
(test-kill-buffer-auto-save-delete-yes): Ditto for the "no" half.
test/src/buffer-tests.el