Skip to content

Commit

Permalink
Update GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescherti committed Aug 14, 2024
1 parent 7b324d0 commit 787378f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/test-easysession.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,55 +51,55 @@ It tests persisting and restoring: file editing buffers and indirect-buffer."

(setq buffer1 (find-file-noselect buffer1-path))
(when (not buffer1)
(error " buffer1 is nil"))
(error "The buffer1 variable is nil"))

(setq buffer2 (find-file-noselect buffer2-path))
(when (not buffer2)
(error " buffer2 is nil"))
(error "The buffer2 variable is nil"))

(setq dired-buffer (dired-noselect dired-buffer-path))
(when (not dired-buffer)
(error "dired-buffer is nil"))
(error "The dired-buffer variable is nil"))

(with-current-buffer buffer1
;; Indirect buffer
(clone-indirect-buffer indirect-buffer1-name nil))
(setq indirect-buffer1 (get-buffer indirect-buffer1-name))
(when (not indirect-buffer1)
(error " indirect-buffer1 is nil"))
(error "The indirect-buffer1 variable is nil"))

;; Save session and kill buffers
(easysession-save)
(kill-buffer buffer1)
(when (get-file-buffer buffer1-path)
(error " buffer1 is still open"))
(error "The second buffer is still open"))

(kill-buffer buffer2)
(when (get-file-buffer buffer2-path)
(error " buffer2 is still open"))
(error "The second buffer is still open"))

(kill-buffer dired-buffer)
(when (buffer-live-p dired-buffer)
(error " dired-buffer is still open"))
(error "The Dired buffer is still open"))

(kill-buffer indirect-buffer1)
(when (get-buffer indirect-buffer1-name)
(error " indirect-buffer1 is still open"))
(error "The indirect buffer is still open"))

;; Load session
(easysession-load)
(setq buffer1 (get-file-buffer buffer1-path))
(when (not buffer1)
(error "Failed to restore buffer2"))
(error "Failed to first buffer"))

(setq buffer2 (get-file-buffer buffer2-path))
(when (not buffer2)
(error "Failed to restore buffer2"))
(error "Failed to the second buffer"))

(setq indirect-buffer1 (get-buffer indirect-buffer1-name))
(when (not indirect-buffer1)
(error
"Failed to restore indirect-buffer1"))
"Failed to restore the indirect buffer"))

(setq dired-buffer (dired-noselect dired-buffer-path))
(when (not dired-buffer)
Expand All @@ -109,7 +109,7 @@ It tests persisting and restoring: file editing buffers and indirect-buffer."
(unless (string= (expand-file-name dired-buffer-path)
(expand-file-name default-directory))
(error
"The dired buffer points to the wrong path")))
"The Dired buffer points to the wrong path")))

;; Success
(message "Success: test-easysession-save-load")))
Expand Down

0 comments on commit 787378f

Please sign in to comment.