<commit_before>(ns cats.labs.promise-spec
  #?(:cljs (:require [cljs.test :as t]
                     [cats.builtin :as b]
                     [cats.context :as ctx :include-macros true]
                     [cats.core :as m :include-macros true]
                     [cats.labs.promise :as pm]
                     [promesa.core :as p])
     :clj  (:require [clojure.test :as t]
                     [cats.builtin :as b]
                     [cats.context :as ctx]
                     [cats.core :as m]
                     [cats.labs.promise :as pm]
                     [promesa.core :as p])))


(defn future-ok
  [sleep value]
  (p/promise (fn [resolve reject]
               (p/schedule sleep #(resolve value)))))

(defn future-fail
  [sleep value]
  (p/promise (fn [_ reject]
               (p/schedule sleep #(reject value)))))


#?(:cljs
   (t/deftest extract-from-rejected-promise
     (let [p1 (p/rejected 42)]
       (t/is (p/rejected? p1))
       (t/is (= (p/extract p1) 42)))))
<commit_msg>update cats.labs.promise-spec tests following Promesa version bump<commit_after>(ns cats.labs.promise-spec
  #?(:cljs (:require [cljs.test :as t]
                     [cats.builtin :as b]
                     [cats.context :as ctx :include-macros true]
                     [cats.core :as m :include-macros true]
                     [cats.labs.promise :as pm]
                     [promesa.core :as p]
                     [promesa.impl :as pi]
                     [promesa.exec :as pe])
     :clj  (:require [clojure.test :as t]
                     [cats.builtin :as b]
                     [cats.context :as ctx]
                     [cats.core :as m]
                     [cats.labs.promise :as pm]
                     [promesa.core :as p]
                     [promesa.exec :as pe])))


(defn future-ok
  [sleep value]
  (p/delay sleep value))

{'fraction_non_alphanumeric': 0.12977921378567583, 'fraction_numerical': 0.003769520732364028, 'mean_word_length': 1.3668789808917197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4802040', 'n_tokens_mistral': 629, 'n_tokens_neox': 580, 'n_words': 151}