(ns babashka.async-test (:require [babashka.test-utils :as test-utils] [clojure.edn :as edn] [clojure.test :as t :refer [deftest is]])) (deftest ^:skip-windows alts!!-test (is (= "process 2\n" (test-utils/bb nil " (defn async-command [& args] (async/thread (apply shell/sh \"bash\" \"-c\" args))) (-> (async/alts!! [(async-command \"sleep 2 && echo process 1\") (async-command \"sleep 1 && echo process 2\")]) first :out str/trim println)")))) (deftest go-test (is (number? (edn/read-string (test-utils/bb nil " (defn calculation-go [] (async/go ;; wait for some stuff (rand-int 1000))) (defn get-result-go [] (async/go (->> (repeatedly 10 calculation-go) (map async/