aboutsummaryrefslogtreecommitdiff
path: root/compat-tests.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-03-14 17:45:32 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-03-14 17:45:32 +0100
commit684ada93bb2e55366bbb48278d344025cfb69b75 (patch)
treeacf5844cfe82159e5f29cb01bcb27bb8f491efe9 /compat-tests.el
parent32e737b145fef05105e2bad4ca34ca41072e9569 (diff)
compat-29: Add directory-abbrev-apply and directory-abbrev-make-regexp
Diffstat (limited to 'compat-tests.el')
-rw-r--r--compat-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/compat-tests.el b/compat-tests.el
index d67365d..8b93c70 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1500,6 +1500,17 @@
(delete-file (file-name-concat dir "file"))
(should (directory-empty-p dir))))
+(ert-deftest directory-abbrev-apply ()
+ (let ((directory-abbrev-alist
+ (list
+ (cons (directory-abbrev-make-regexp "/long/path/to/foo") "foo:")
+ (cons (directory-abbrev-make-regexp "/long/path/to/bar") "bar:"))))
+ (should-equal (directory-abbrev-apply "/long/path/to/foo/file") "foo:file")
+ (should-equal (directory-abbrev-apply "/long/path/to/bar/file") "bar:file")))
+
+(ert-deftest directory-abbrev-make-regexp ()
+ (should-equal (directory-abbrev-make-regexp "/home/user/") "\\`/home/user/\\(/\\|\\'\\)"))
+
(ert-deftest make-empty-file ()
(ert-with-temp-directory dir
(let ((file (file-name-concat dir "file")))