branch: externals/compat
commit 6d8f1aefd0e62d9ecc336491035ee48fb078f4fa
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    Test file-attribute-collect
---
 compat-26.el    | 2 +-
 compat-tests.el | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/compat-26.el b/compat-26.el
index 8ad7055809..af1b337b3f 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -455,7 +455,7 @@ It is a nonnegative integer."
 It is an integer."
   (nth 11 attributes))
 
-(compat-defun file-attribute-collect (attributes &rest attr-names) ;; 
<UNTESTED>
+(compat-defun file-attribute-collect (attributes &rest attr-names) ;; <OK>
   "Return a sublist of ATTRIBUTES returned by `file-attributes'.
 ATTR-NAMES are symbols with the selected attribute names.
 
diff --git a/compat-tests.el b/compat-tests.el
index 64eca34ed3..5d6f1786f0 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -741,6 +741,11 @@
     (should-equal (file-attribute-inode-number attrs) 'inode-number)
     (should-equal (file-attribute-device-number attrs) 'device-number)))
 
+(ert-deftest file-attribute-collect ()
+  (let ((attrs '(t l u g a m s S m U i d)))
+    (should-equal (file-attribute-collect attrs 'group-id 'user-id) '(g u))
+    (should-equal (file-attribute-collect attrs 'size 'inode-number 'type) '(S 
i t))))
+
 (ert-deftest file-size-human-readable ()
   (should-equal "1000" (compat-call file-size-human-readable 1000))
   (should-equal "1k" (compat-call file-size-human-readable 1024))

Reply via email to