Permalink
Browse files

Tests for useful.ns

  • Loading branch information...
1 parent d4b4c05 commit 91b55a7aa6f245aa23cd602a5e2ea3ba138702f8 @amalloy amalloy committed Nov 8, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/useful/ns_test.clj
View
@@ -0,0 +1,20 @@
+(ns useful.ns-test
+ (:use clojure.test useful.ns)
+ (:require [useful.fn :as fn]
+ [useful.macro :as macro]))
+
+(defalias fixit fn/fix)
+(alias-var 'as-macro #'macro/anon-macro)
+(alias-ns 'useful.string)
+
+(deftest test-var-name
+ (is (= 'clojure.core/inc (var-name #'inc))))
+
+(deftest test-defalias
+ (is (= 1 (fixit 0 even? inc))))
+
+(deftest test-alias-var
+ (is (= 3 (as-macro [x y] `(+ ~x ~y) 1 2))))
+
+(deftest test-alias-ns
+ (is (bound? #'useful.ns-test/camelize)))

0 comments on commit 91b55a7

Please sign in to comment.