From: Ramakrishnan Muthukrishnan Date: Thu, 27 May 2010 15:36:26 +0000 (+0530) Subject: added more tests X-Git-Url: https://git.rkrishnan.org/%5B/frontends/flags/%22doc.html/rgr-080307.php?a=commitdiff_plain;h=f88e76d31312202c3be6fa105f168130bb029e1f;p=sicp.git added more tests --- diff --git a/src/sicp/ex1_41.clj b/src/sicp/ex1_41.clj index 17bf21c..c6a16f0 100644 --- a/src/sicp/ex1_41.clj +++ b/src/sicp/ex1_41.clj @@ -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