Skip to content

Commit 55225fa

Browse files
committed
add codox task
1 parent c5a524c commit 55225fa

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

deps.edn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,12 @@
2222
;; clj -M:outdated
2323
:outdated {:extra-deps {com.github.liquidz/antq {:mvn/version "2.11.1250"}}
2424
:main-opts ["-m" "antq.core"]}
25+
26+
;; Regenerate docs in docs/
27+
;; clj -X:docs
28+
:docs {:extra-deps {codox/codox {:mvn/version "0.10.8"}}
29+
:exec-fn codox.main/generate-docs
30+
:exec-args {:source-paths ["src/main/clojure"]
31+
:namespaces [clojure.core.async clojure.core.async.flow clojure.core.async.flow.spi]
32+
:output-path "apidocs"}}
2533
}}

src/main/clojure/clojure/core/async.clj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ to catch and handle."
277277
"returns derefable [val port] if immediate, nil if enqueued"
278278
[fret ports opts]
279279
(assert (pos? (count ports)) "alts must have at least one channel operation")
280+
(doseq [port ports :when (vector? port)]
281+
(assert (not (nil? (nth port 1))) "alts can't put nil on channel"))
280282
(let [flag (alt-flag)
281283
ports (vec ports) ;; ensure vector for indexed nth
282284
n (count ports)

src/test/clojure/clojure/core/async_test.clj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,10 @@
465465
:ok
466466
(catch AssertionError e
467467
:ko))))))
468+
469+
(deftest test-alts-put-nil-invalid
470+
(is
471+
(thrown? AssertionError
472+
(let [c1 (a/chan)
473+
c2 (a/chan)]
474+
(a/alts!! [c1 [c2 nil]])))))

0 commit comments

Comments
 (0)