From 281f48f19ecad706a639d57cb937afb0b97eded7 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Tue, 17 Jan 2023 16:59:13 -0800 Subject: [PATCH] ; Fix Eshell prompt tests when the current user is root * test/lisp/eshell/em-prompt-tests.el (em-prompt-test/field-properties) (em-prompt-test/field-properties/no-highlight): Handle the case when the current user is root. --- test/lisp/eshell/em-prompt-tests.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/lisp/eshell/em-prompt-tests.el b/test/lisp/eshell/em-prompt-tests.el index 91464a98c26..db45e2ae3a7 100644 --- a/test/lisp/eshell/em-prompt-tests.el +++ b/test/lisp/eshell/em-prompt-tests.el @@ -44,7 +44,8 @@ (should (equal-including-properties last-prompt (propertize - (format "%s $ " (directory-file-name default-directory)) + (format "%s %s " (directory-file-name default-directory) + (if (= (file-user-uid) 0) "#" "$")) 'read-only t 'field 'prompt 'font-lock-face 'eshell-prompt @@ -68,7 +69,8 @@ This tests the case when `eshell-highlight-prompt' is nil." (should (equal-including-properties last-prompt (propertize - (format "%s $ " (directory-file-name default-directory)) + (format "%s %s " (directory-file-name default-directory) + (if (= (file-user-uid) 0) "#" "$")) 'field 'prompt 'front-sticky '(field) 'rear-nonsticky '(field)))) -- 2.39.5