Skip to content

Commit

Permalink
add codox task
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Jan 21, 2025
1 parent c5a524c commit 55225fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@
;; clj -M:outdated
:outdated {:extra-deps {com.github.liquidz/antq {:mvn/version "2.11.1250"}}
:main-opts ["-m" "antq.core"]}

;; Regenerate docs in docs/
;; clj -X:docs
:docs {:extra-deps {codox/codox {:mvn/version "0.10.8"}}
:exec-fn codox.main/generate-docs
:exec-args {:source-paths ["src/main/clojure"]
:namespaces [clojure.core.async clojure.core.async.flow clojure.core.async.flow.spi]
:output-path "apidocs"}}
}}
2 changes: 2 additions & 0 deletions src/main/clojure/clojure/core/async.clj
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ to catch and handle."
"returns derefable [val port] if immediate, nil if enqueued"
[fret ports opts]
(assert (pos? (count ports)) "alts must have at least one channel operation")
(doseq [port ports :when (vector? port)]
(assert (not (nil? (nth port 1))) "alts can't put nil on channel"))
(let [flag (alt-flag)
ports (vec ports) ;; ensure vector for indexed nth
n (count ports)
Expand Down
7 changes: 7 additions & 0 deletions src/test/clojure/clojure/core/async_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -465,3 +465,10 @@
:ok
(catch AssertionError e
:ko))))))

(deftest test-alts-put-nil-invalid
(is
(thrown? AssertionError
(let [c1 (a/chan)
c2 (a/chan)]
(a/alts!! [c1 [c2 nil]])))))

0 comments on commit 55225fa

Please sign in to comment.