emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 469fcaa: Add test for Bug#21454


From: Tino Calancha
Subject: [Emacs-diffs] master 469fcaa: Add test for Bug#21454
Date: Tue, 13 Sep 2016 09:08:47 +0000 (UTC)

branch: master
commit 469fcaa7f8d2ad57571a0af55a4082700345e4a5
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>

    Add test for Bug#21454
    
    * test/lisp/legacy/files-tests.el (files-test-bug-21454): New test.
---
 test/lisp/legacy/files-tests.el |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/test/lisp/legacy/files-tests.el b/test/lisp/legacy/files-tests.el
index 3c6f61b..56150c1 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]