summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-07-24 17:22:43 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-07-24 17:22:43 +0200
commitb4543dfa9e72deeee607ffa9396a680c51a00968 (patch)
tree09493193d03f4961a8007c709f1b8a8598ac26d6 /test
parent8cd66a3170b4117d3cbcdce7a09837e3c2ea0e43 (diff)
downloademacs-b4543dfa9e72deeee607ffa9396a680c51a00968.tar.gz
emacs-b4543dfa9e72deeee607ffa9396a680c51a00968.tar.bz2
emacs-b4543dfa9e72deeee607ffa9396a680c51a00968.zip
Extend directory-append to take an arbitrary number of components
* doc/lispref/files.texi (Directory Names): Document it. * lisp/emacs-lisp/shortdoc.el (file-name): Add new example. * src/fileio.c (Fdirectory_append): Change the function to take an arbitrary number of components.
Diffstat (limited to 'test')
-rw-r--r--test/src/fileio-tests.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index 80afeae41ba..702659fa395 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -162,10 +162,16 @@ Also check that an encoding error can appear in a symlink."
(ert-deftest fileio-tests/directory-append ()
(should (equal (directory-append "foo" "bar") "foo/bar"))
+ (should (equal (directory-append "foo" "bar") "foo/bar"))
+ (should (equal (directory-append "foo" "bar" "zot") "foo/bar/zot"))
(should (equal (directory-append "foo/" "bar") "foo/bar"))
(should (equal (directory-append "foo//" "bar") "foo//bar"))
+ (should (equal (directory-append "foo/" "bar/" "zot") "foo/bar/zot"))
+ (should (equal (directory-append "fóo" "bar") "fóo/bar"))
+ (should (equal (directory-append "foo" "bár") "foo/bár"))
+ (should (equal (directory-append "fóo" "bár") "fóo/bár"))
(should-error (directory-append "foo" ""))
- (should (equal (directory-append "" "bar") "bar"))
+ (should-error (directory-append "" "bar"))
(should-error (directory-append "" "")))
;;; fileio-tests.el ends here