Skip to content

Commit ebf0d21

Browse files
windows-safe test for relative-path-string
1 parent 4f9a78d commit ebf0d21

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/clojure/clojure/contrib/test_io.clj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@
3131
(is (thrown? ArithmeticException (/ 1 0)))
3232
(is (thrown? java.io.IOException (delete-file not-file)))
3333
(is (delete-file not-file :silently))))
34+
35+
(deftest test-relative-path-string
36+
(testing "strings"
37+
(is (= "foo" (relative-path-string "foo"))))
38+
(testing "absolute path strings are forbidden"
39+
(is (thrown? IllegalArgumentException (relative-path-string (str File/separator "baz")))))
40+
(testing "relative File paths"
41+
(is (= "bar" (relative-path-string (File. "bar")))))
42+
(testing "absolute File paths are forbidden"
43+
(is (thrown? IllegalArgumentException (relative-path-string (File. (str File/separator "quux")))))))

0 commit comments

Comments
 (0)