Skip to content

Commit

Permalink
move unit test for unroll
Browse files Browse the repository at this point in the history
  • Loading branch information
erdos committed May 14, 2024
1 parent 1a12cc6 commit 28cdb1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/stencil/fs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@

;; remove /../ parts
(defn unroll [^File f] (-> f .toPath .normalize .toFile))

;(println :! (unroll (File. "a/b/x/../c/dd")))
(assert (= (File. "a/b/c/d") (unroll (File. "a/b/x/../c/d"))))
5 changes: 4 additions & 1 deletion test/stencil/fs_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@
(is (true? (fs/exists? (file "/tmp"))))
(is (true? (fs/exists? (file "src"))))
(is (false? (fs/exists? (file "/does/not-exist"))))
(is (false? (fs/exists? (file "does/not-exist")))))
(is (false? (fs/exists? (file "does/not-exist")))))

(deftest test-unroll
(is (= (file "a/b/c/d") (fs/unroll (file "a/b/x/../c/d")))))

0 comments on commit 28cdb1f

Please sign in to comment.