summaryrefslogtreecommitdiff
path: root/test/lisp/legacy/files-tests.el
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2016-09-13 18:01:38 +0900
committerTino Calancha <tino.calancha@gmail.com>2016-09-13 18:01:38 +0900
commit469fcaa7f8d2ad57571a0af55a4082700345e4a5 (patch)
tree0324476686e918db6e690c8bafd455eeff63bb0a /test/lisp/legacy/files-tests.el
parentead76c4603f2c4a1761ab8a7dd5cf6f56e782fb2 (diff)
downloademacs-469fcaa7f8d2ad57571a0af55a4082700345e4a5.tar.gz
emacs-469fcaa7f8d2ad57571a0af55a4082700345e4a5.tar.bz2
emacs-469fcaa7f8d2ad57571a0af55a4082700345e4a5.zip
Add test for Bug#21454
* test/lisp/legacy/files-tests.el (files-test-bug-21454): New test.
Diffstat (limited to 'test/lisp/legacy/files-tests.el')
-rw-r--r--test/lisp/legacy/files-tests.el28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/lisp/legacy/files-tests.el b/test/lisp/legacy/files-tests.el
index 3c6f61b792c..56150c1a7f0 100644
--- a/test/lisp/legacy/files-tests.el
+++ b/test/lisp/legacy/files-tests.el
@@ -169,4 +169,32 @@ form.")
;; Stop the above "Local Var..." confusing Emacs.
+(ert-deftest files-test-bug-21454 ()
+ "Test for http://debbugs.gnu.org/21454 ."
+ :expected-result :failed
+ (let ((input-result
+ '(("/foo/bar//baz/:/bar/foo/baz//" nil ("/foo/bar/baz/" "/bar/foo/baz/"))
+ ("/foo/bar/:/bar/qux/:/qux/foo" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("//foo/bar/:/bar/qux/:/qux/foo/" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo/bar/:/bar/qux/:/qux/foo/" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo//bar/:/bar/qux/:/qux/foo/" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo//bar/:/bar/qux/:/qux/foo" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo/bar" "$FOO/baz/:/qux/foo/" ("/foo/bar/baz/" "/qux/foo/"))
+ ("//foo/bar/" "$FOO/baz/:/qux/foo/" ("/foo/bar/baz/" "/qux/foo/"))))
+ (foo-env (getenv "FOO"))
+ (bar-env (getenv "BAR")))
+ (unwind-protect
+ (dolist (test input-result)
+ (let ((foo (nth 0 test))
+ (bar (nth 1 test))
+ (res (nth 2 test)))
+ (setenv "FOO" foo)
+ (if bar
+ (progn
+ (setenv "BAR" bar)
+ (should (equal res (parse-colon-path (getenv "BAR")))))
+ (should (equal res (parse-colon-path "$FOO"))))))
+ (setenv "FOO" foo-env)
+ (setenv "BAR" bar-env))))
+
;;; files.el ends here