Bug in test_java_utils.clj
I got test error today (21 Jan 2009, GMT+5:30) on Clojure-contrib 1.1 (maven branch) while running "mvn assembly:assembly" on Windows XP 32-bit on JDK 1.6.0_18.
<snip>passing tests</snip>
FAIL in (test-relative-path-string) (run-test503247994263281606.clj:130)
absolute path strings are forbidden
expected: (thrown? IllegalArgumentException (relative-path-string "/baz"))
actual: nil
FAIL in (test-relative-path-string) (run-test503247994263281606.clj:130)
absolute File paths are forbidden
expected: (thrown? IllegalArgumentException (relative-path-string (File. "/quux")))
actual: nil
FAIL in (test-file) (run-test503247994263281606.clj:130)
no sneaking in absolute paths!
expected: (thrown? IllegalArgumentException (file "foo" "bar" "/boom" "baz" "quux"))
actual: nil
FAIL in (test-as-url) (run-test503247994263281606.clj:130)
expected: (= (URL. "file:/foo") (as-url (File. "/foo")))
actual: (not (= #<URL file:/foo> #<URL file:/C:/foo>))
<snip>passing tests</snip>
4 failures, 0 errors
<snip>passing tests</snip>
FAIL in (test-relative-path-string) (run-test503247994263281606.clj:130)
absolute path strings are forbidden
expected: (thrown? IllegalArgumentException (relative-path-string "/baz"))
actual: nil
FAIL in (test-relative-path-string) (run-test503247994263281606.clj:130)
absolute File paths are forbidden
expected: (thrown? IllegalArgumentException (relative-path-string (File. "/quux")))
actual: nil
FAIL in (test-file) (run-test503247994263281606.clj:130)
no sneaking in absolute paths!
expected: (thrown? IllegalArgumentException (file "foo" "bar" "/boom" "baz" "quux"))
actual: nil
FAIL in (test-as-url) (run-test503247994263281606.clj:130)
expected: (= (URL. "file:/foo") (as-url (File. "/foo")))
actual: (not (= #<URL file:/foo> #<URL file:/C:/foo>))
<snip>passing tests</snip>
4 failures, 0 errors
Leave a comment
on 2010-02-03 18:05 *
By stuartsierra
This is probably caused by the way Windows handles paths. Needs a fix for portability.
Using File/separator should work cross-platform. Added in commit ebf0d212dcc076ebee6984d276ff037ce1a7ecbe.