We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f9a78d commit ebf0d21Copy full SHA for ebf0d21
src/test/clojure/clojure/contrib/test_io.clj
@@ -31,3 +31,13 @@
31
(is (thrown? ArithmeticException (/ 1 0)))
32
(is (thrown? java.io.IOException (delete-file not-file)))
33
(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