tests fail on Mac OS X

Issue #7 resolved
Anonymous created an issue

The Mac does something funny with tempdirs. The canonical path starts with /private/var/ but the absolute path starts with just /var -- but they both actually point to the same thing. The tests with the walk function fail because of the (string) difference in pathnames. The simplest work-around is to wrap the calls to (tempdir) with normpath.

Context diff below:

tebeka-fs-020a4c9edb74/test/fs_test.clj Thu Oct 13 19:41:04 2011 --- ./test/fs_test.clj Thu Nov 3 15:37:53 2011 *** 102,108 **** (is (> (count (cwd)) 3)))

(defn create-walk-dir [] ! (let [root (tempdir)] (mkdir (join root "a")) (mkdir (join root "b")) (spit (join root "1") "1") --- 102,108 ---- (is (> (count (cwd)) 3)))

(defn create-walk-dir [] ! (let [root (normpath (tempdir))] (mkdir (join root "a")) (mkdir (join root "b")) (spit (join root "1") "1")


157,163 *

(deftest test-copy-tree (let [from (create-walk-dir) ! to (tempdir)] (swap! walk-atom (fn [_] #{})) (let [path (copy-tree from to) dest (join to (basename from))] --- 157,163 ----

(deftest test-copy-tree (let [from (create-walk-dir) ! to (normpath (tempdir))] (swap! walk-atom (fn [_] #{})) (let [path (copy-tree from to) dest (join to (basename from))]

Comments (2)

  1. Log in to comment