]> git.rkrishnan.org Git - sicp.git/commitdiff
added more tests
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Thu, 27 May 2010 15:36:26 +0000 (21:06 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Thu, 27 May 2010 15:36:26 +0000 (21:06 +0530)
src/sicp/ex1_41.clj

index 17bf21c595a97e2ca00c4b16d9e7b679905badcd..c6a16f028f9c704f9dc662a5f3033f3ae5956a94 100644 (file)
@@ -6,6 +6,18 @@
 (defn doub [f]
   (fn [x] (f (f x))))
 
+(deftest test-doub-doub-doub-inc-5
+  (is (= (((doub (doub doub)) inc) 5)
+        21)))
+
+(deftest test-doub-inc-1
+  (is (= ((doub inc) 1)
+        3)))
+
+(deftest test-doub-doub-inc-1
+  (is (= (((doub (doub doub)) inc) 1)
+        17)))
+
 (comment
 (((doub (doub doub)) inc) 5)
 ;;=> 21