[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e89b94f 2/3: Add test for file-name-base
From: |
Stefan Kangas |
Subject: |
master e89b94f 2/3: Add test for file-name-base |
Date: |
Wed, 27 Oct 2021 00:37:01 -0400 (EDT) |
branch: master
commit e89b94f46d8a0ef3a270c31f3129eb8b4c8da646
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Add test for file-name-base
* test/lisp/files-tests.el (files-tests-file-name-base): New test.
---
test/lisp/files-tests.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index b283a51..c8b80e3 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1551,6 +1551,15 @@ The door of all subtleties!
(should-error (file-name-with-extension "Jack" "."))
(should-error (file-name-with-extension "/is/a/directory/" "css")))
+(ert-deftest files-tests-file-name-base ()
+ (should (equal (file-name-base) "files-tests"))
+ (should (equal (file-name-base "") ""))
+ (should (equal (file-name-base "/foo/") ""))
+ (should (equal (file-name-base "/foo") "foo"))
+ (should (equal (file-name-base "/foo/bar") "bar"))
+ (should (equal (file-name-base "foo") "foo"))
+ (should (equal (file-name-base "foo/bar") "bar")))
+
(ert-deftest files-test-dir-locals-auto-mode-alist ()
"Test an `auto-mode-alist' entry in `.dir-locals.el'"
(find-file (ert-resource-file "whatever.quux"))