Skip to content

Commit 4f8621a

Browse files
committed
Added tests for flow/futurize
1 parent 3c6e97f commit 4f8621a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
;; Copyright (c) Rich Hickey and contributors. All rights reserved.
2+
;; The use and distribution terms for this software are covered by the
3+
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
4+
;; which can be found in the file epl-v10.html at the root of this distribution.
5+
;; By using this software in any fashion, you are agreeing to be bound by
6+
;; the terms of this license.
7+
;; You must not remove this notice, or any other, from this software.
8+
9+
(ns clojure.core.async.flow-test
10+
(:require [clojure.test :refer :all]
11+
[clojure.core.async.flow :as flow]))
12+
13+
(deftest test-futurize
14+
(testing ""
15+
(let [es (reify java.util.concurrent.ExecutorService
16+
(^java.util.concurrent.Future submit [_ ^Callable f]
17+
(future-call (comp vector f))))]
18+
(is (= 16 @((flow/futurize #(* % %) {:exec :mixed}) 4)))
19+
(is (= 16 @((flow/futurize #(* % %)) 4)))
20+
(is (= [16] @((flow/futurize #(* % %) {:exec es}) 4))))))
21+

0 commit comments

Comments
 (0)