Add compatibility with babashka
This commit is contained in:
parent
62375212a8
commit
283cb13e58
2 changed files with 5 additions and 3 deletions
|
|
@ -99,7 +99,8 @@
|
||||||
(not (arities 2)) (conj (let [[[acc karg varg] & body] (arities 3)]
|
(not (arities 2)) (conj (let [[[acc karg varg] & body] (arities 3)]
|
||||||
`([~acc [~karg ~varg]] ~@body))))]
|
`([~acc [~karg ~varg]] ~@body))))]
|
||||||
`(reify
|
`(reify
|
||||||
~@(macros/case :clj '[clojure.lang.Fn])
|
#?@(:bb [] ;; babashka currently only supports reify with one Java interface at a time
|
||||||
|
:default [~@(macros/case :clj '[clojure.lang.Fn])])
|
||||||
KvRfable
|
KvRfable
|
||||||
(some-kvrf [this#] this#)
|
(some-kvrf [this#] this#)
|
||||||
~(macros/case :cljs `core/IFn :clj 'clojure.lang.IFn)
|
~(macros/case :cljs `core/IFn :clj 'clojure.lang.IFn)
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,8 @@
|
||||||
(is (= {0 :ok 2 :ok 4 :ok 6 :ok 8 :ok} (x/without (zipmap (range 10) (repeat :ok)) (filter odd?) (range 20))))
|
(is (= {0 :ok 2 :ok 4 :ok 6 :ok 8 :ok} (x/without (zipmap (range 10) (repeat :ok)) (filter odd?) (range 20))))
|
||||||
(is (= #{0 2 4 6 8 } (x/without (set (range 10)) (filter odd?) (range 20)))))
|
(is (= #{0 2 4 6 8 } (x/without (set (range 10)) (filter odd?) (range 20)))))
|
||||||
|
|
||||||
#?(:clj
|
#?(:bb nil ;; babashka doesn't currently support calling iterator on range type
|
||||||
|
:clj
|
||||||
(deftest iterator
|
(deftest iterator
|
||||||
(is (true? (.hasNext (x/iterator x/count (.iterator (range 5))))))
|
(is (true? (.hasNext (x/iterator x/count (.iterator (range 5))))))
|
||||||
(is (is (= [5] (iterator-seq (x/iterator x/count (.iterator (range 5)))))))
|
(is (is (= [5] (iterator-seq (x/iterator x/count (.iterator (range 5)))))))
|
||||||
|
|
@ -139,4 +140,4 @@
|
||||||
(is (= (range 100) (x/into [] (x/sort) (shuffle (range 100)))))
|
(is (= (range 100) (x/into [] (x/sort) (shuffle (range 100)))))
|
||||||
(is (= (reverse (range 100)) (x/into [] (x/sort >) (shuffle (range 100)))))
|
(is (= (reverse (range 100)) (x/into [] (x/sort >) (shuffle (range 100)))))
|
||||||
(is (= (sort-by str (range 100)) (x/into [] (x/sort-by str) (shuffle (range 100)))))
|
(is (= (sort-by str (range 100)) (x/into [] (x/sort-by str) (shuffle (range 100)))))
|
||||||
(is (= (sort-by str (comp - compare) (range 100)) (x/into [] (x/sort-by str (comp - compare)) (shuffle (range 100))))))
|
(is (= (sort-by str (comp - compare) (range 100)) (x/into [] (x/sort-by str (comp - compare)) (shuffle (range 100))))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue