Permalink
Browse files

Basic example tests for flow-let

  • Loading branch information...
1 parent 349f4f1 commit 93245fa95bbd8e843d194bc07eadf2db21fdb65b @stuartsierra committed Nov 10, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/com/stuartsierra/flow_test.clj
View
16 test/com/stuartsierra/flow_test.clj
@@ -81,3 +81,19 @@
(deftest compiled-modified
(is (= {:f 7 :e 1006, :c 1003, :d 3, :a 1, :b 2}
(f3-ab-all {:a 1 :b 2}))))
+
+(deftest t-flow-let
+ (is (= {:a 3, :b 2}
+ (flow-let [a ([b] (+ b 1))
+ b ([] 2)]
+ {:a a :b b})))
+ (is (= {:a 3, :b 2, :c 15}
+ (flow-let [a ([b] (+ b 1))
+ b ([] 2)
+ c ([a b] (+ a b 10))]
+ {:a a :b b :c c})))
+ (is (= {:a 3, :b 2, :c 15}
+ (flow-let [c ([a b] (+ a b 10))
+ a ([b] (+ b 1))
+ b ([] 2)]
+ {:a a :b b :c c}))))

0 comments on commit 93245fa

Please sign in to comment.