eschulte pushed a commit to branch master in repository elpa. commit 9a4d4b7a6de64aaa8f2ce8ed89b9cee37de898a5 Author: Eric Schulte <schulte.e...@gmail.com> Date: Fri May 2 09:25:52 2014 -0600
don't assume temporary file directory name Instead use temporary-file-directory. Hopefully this helps for testing on windows. --- web-server-test.el | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/web-server-test.el b/web-server-test.el index 769d203..a11093c 100644 --- a/web-server-test.el +++ b/web-server-test.el @@ -195,15 +195,21 @@ org=-+one%0A-+two%0A-+three%0A-+four%0A%0A&beg=646&end=667&path=%2Fcomplex.org") "you said \"foo\"\n")))) (ert-deftest ws/in-directory-p () - (should-not (ws-in-directory-p "/tmp/" "foo/bar/../../../")) - (should (ws-in-directory-p "/tmp/" "foo/bar/../../../tmp/baz")) - (should (ws-in-directory-p "/tmp/" "./")) - (should-not (ws-in-directory-p "/tmp/" "/~/pics")) - (should-not (ws-in-directory-p "/tmp/" "~/pics")) - (should-not (ws-in-directory-p "/tmp/" "/pics")) - (should-not (ws-in-directory-p "/tmp/" "../pics")) - (should (ws-in-directory-p "/tmp/" "pics")) - (should-not (ws-in-directory-p "/tmp/" ".."))) + (mapc (lambda (pair) + (let ((should-or-not (car pair)) + (dir (cdr pair))) + (should + (funcall (if should-or-not #'identity #'not) + (ws-in-directory-p temporary-file-directory dir))))) + `((nil . "foo/bar/../../../") + (t . ,(concat "foo/bar/../../../" temporary-file-directory "/baz")) + (t . "./") + (nil . "/~/pics") + (nil . "~/pics") + (nil . "/pics") + (nil . "../pics") + (t . "pics") + (nil . "..")))) (ert-deftest ws/parse-basic-authorization () "Test that a number of headers parse successfully."