]> git.eshelyaron.com Git - emacs.git/commitdiff
* test/lisp/url/url-file-tests.el (url-file): Fix for POSIX filenames.
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 28 Jun 2019 13:22:00 +0000 (15:22 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 28 Jun 2019 13:22:00 +0000 (15:22 +0200)
test/lisp/url/url-file-tests.el

index 84b7c3a70b0fb175e4b12551914feee12578f527..58e0250ba96c595429ae7f631e6eea1dd1e71822 100644 (file)
 
 (ert-deftest url-file ()
   "Test reading file via file:/// URL."
-  (let ((file (expand-file-name "file.txt" url-file-tests-data-directory)))
+  (let* ((file (expand-file-name "file.txt" url-file-tests-data-directory))
+         (uri-prefix (if (eq (aref file 0) ?/) "file://" "file:///")))
     (should (equal
              (with-current-buffer
-                 (url-file (url-generic-parse-url (concat "file:///" file))
+                 (url-file (url-generic-parse-url (concat uri-prefix file))
                            #'ignore nil)
                (prog1 (buffer-substring (point) (point-max))
                  (kill-buffer)))