Commit 469fcaa7 authored by Tino Calancha's avatar Tino Calancha
Browse files

Add test for Bug#21454

* test/lisp/legacy/files-tests.el (files-test-bug-21454): New test.
parent ead76c46
......@@ -169,4 +169,32 @@ form.")
;; Stop the above "Local Var..." confusing Emacs.
(ert-deftest files-test-bug-21454 ()
"Test for ."
: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")))
(dolist (test input-result)
(let ((foo (nth 0 test))
(bar (nth 1 test))
(res (nth 2 test)))
(setenv "FOO" foo)
(if bar
(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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment