diff options
| author | Jim Porter | 2022-04-01 22:06:02 -0700 |
|---|---|---|
| committer | Eli Zaretskii | 2022-04-17 10:29:07 +0300 |
| commit | 3dc73569b405d80e89c2965daba31ea4ee6664f0 (patch) | |
| tree | 5962ada86eaaca6c1748b0abdd5dab619150a8eb /test/lisp/eshell | |
| parent | 6358cbc21a816ac95c2e6e22e087ccd3736874bc (diff) | |
| download | emacs-3dc73569b405d80e89c2965daba31ea4ee6664f0.tar.gz emacs-3dc73569b405d80e89c2965daba31ea4ee6664f0.zip | |
Add 'G' argument predicate in Eshell
* lisp/eshell/em-pred.el (eshell-predicate-alist): Add 'G' predicate.
(eshell-predicate-help-string): Document it. (Bug#54470)
* test/lisp/eshell/em-pred-tests.el
(em-pred-test/predicate-effective-gid): New test.
* doc/misc/eshell.text (Argument Predication): Document 'G' predicate.
Diffstat (limited to 'test/lisp/eshell')
| -rw-r--r-- | test/lisp/eshell/em-pred-tests.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lisp/eshell/em-pred-tests.el b/test/lisp/eshell/em-pred-tests.el index 74dad9f8b87..fbf8945215e 100644 --- a/test/lisp/eshell/em-pred-tests.el +++ b/test/lisp/eshell/em-pred-tests.el | |||
| @@ -225,6 +225,14 @@ read, write, and execute predicates to query the file's modes." | |||
| 225 | (should (equal (eshell-eval-predicate files "U") | 225 | (should (equal (eshell-eval-predicate files "U") |
| 226 | '("/fake/uid=1"))))))) | 226 | '("/fake/uid=1"))))))) |
| 227 | 227 | ||
| 228 | (ert-deftest em-pred-test/predicate-effective-gid () | ||
| 229 | "Test that \"G\" matches files owned by the effective GID." | ||
| 230 | (eshell-with-file-attributes-from-name | ||
| 231 | (cl-letf (((symbol-function 'group-gid) (lambda () 1))) | ||
| 232 | (let ((files '("/fake/gid=1" "/fake/gid=2"))) | ||
| 233 | (should (equal (eshell-eval-predicate files "G") | ||
| 234 | '("/fake/gid=1"))))))) | ||
| 235 | |||
| 228 | (ert-deftest em-pred-test/predicate-links () | 236 | (ert-deftest em-pred-test/predicate-links () |
| 229 | "Test that \"l\" filters by number of links." | 237 | "Test that \"l\" filters by number of links." |
| 230 | (eshell-with-file-attributes-from-name | 238 | (eshell-with-file-attributes-from-name |