Skip to content
Browse files

Add some basic util tests (Issue #70).

  • Loading branch information...
1 parent ab2086a commit 000d88617fb5a5d1b6b9c43edb369a2629820826 @emezeske committed Apr 7, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 support/test/cljsbuild/test/util.clj
View
20 support/test/cljsbuild/test/util.clj
@@ -0,0 +1,20 @@
+(ns cljsbuild.test.util
+ (:use
+ cljsbuild.util
+ clojure.test))
+
+(deftest test-join-paths
+ (is (= "") (join-paths))
+ (is (= "a") (join-paths "a"))
+ (is (= "a/b/c") (join-paths "a" "b" "c")))
+
+(deftest test-filter-by-ext
+ (let [files ["a.a" "b.b" "c.c" "d.d" "e.d" "f.d" "1/2/3/4/5.e"]]
+ (are [x y] (= x y)
+ [] (filter-by-ext files #{"q" "r" "s"})
+ ["a.a"] (filter-by-ext files #{"a"})
+ ["d.d" "e.d" "f.d"] (filter-by-ext files #{"d"})
+ ["1/2/3/4/5.e"] (filter-by-ext files #{"e"})
+ files (filter-by-ext files #{"a" "b" "c" "d" "e"}))))
+
+; TODO: More tests!

0 comments on commit 000d886

Please sign in to comment.
Something went wrong with that request. Please try again.