]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix Eshell prompt tests when the current user is root
authorJim Porter <jporterbugs@gmail.com>
Wed, 18 Jan 2023 00:59:13 +0000 (16:59 -0800)
committerJim Porter <jporterbugs@gmail.com>
Wed, 18 Jan 2023 00:59:13 +0000 (16:59 -0800)
* 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

index 91464a98c26812c536d06124434e4a142a9061a2..db45e2ae3a73cd648789ea020598d8d8aff03659 100644 (file)
@@ -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))))