From 8386950819207edc90eb2de222e3c666f6cdb614 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 18 Apr 2025 09:35:14 -0400 Subject: [PATCH] (tab-bar-tests-quit-restore-window): Try and clarify the skip * 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 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/lisp/tab-bar-tests.el b/test/lisp/tab-bar-tests.el index 06a52ed42b1..257f6bd37d3 100644 --- a/test/lisp/tab-bar-tests.el +++ b/test/lisp/tab-bar-tests.el @@ -52,13 +52,16 @@ (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")))) -- 2.39.5