]> git.eshelyaron.com Git - emacs.git/commitdiff
(tab-bar-tests-quit-restore-window): Try and clarify the skip
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Apr 2025 13:35:14 +0000 (09:35 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 21 Apr 2025 20:33:51 +0000 (22:33 +0200)
* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
Rewrite the `skip-unless` based on the code's history because
I found the current code quite confusing.

(cherry picked from commit f5e6f284e9f970cdbdfb25c8ae8308165f3ce5c5)

test/lisp/tab-bar-tests.el

index 06a52ed42b117ae6552338218289d19c7652aa72..257f6bd37d37df1048bb03096a7e958af3a1c1ee 100644 (file)
   (tab-bar-tabs-set nil))
 
 (ert-deftest tab-bar-tests-quit-restore-window ()
-  ;; Emba runs the container without "--tty"
-  ;; (the environment variable "TERM" is nil), and this
-  ;; test fails with '(error "Could not open file: /dev/tty")'.
-  ;; Therefore skip it unless it can use '(tty-type . "linux")'.
-  (skip-unless (or (and (eq system-type 'gnu/linux) (getenv "TERM"))
-                   (and (not noninteractive)
-                        (eq system-type 'windows-nt))))
+  (skip-when (pcase system-type
+               ;; Skip test on MS-Windows in batch mode, since terminal
+               ;; frames cannot be created in that case.
+               ('windows-nt noninteractive)
+               ;; Emba runs the container without "--tty"
+               ;; (the environment variable "TERM" is nil), and this
+               ;; test fails with '(error "Could not open file: /dev/tty")'.
+               ;; Therefore skip it unless it can use '(tty-type . "linux")'.
+               ('gnu/linux (null (getenv "TERM")))))
+
   (let* ((frame-params (when noninteractive
                          '((window-system . nil)
                            (tty-type . "linux"))))