Four general gaps, shaken out by loading clojure.spec.alpha: - Special forms were shadowable by a same-named macro. analyze-list macroexpanded before checking special forms, so a ns that redefs def/and/or (spec excludes them via :refer-clojure :exclude) made a bare def resolve to the macro instead of the special form, breaking every defn after. Now a head in the special-form set is never macroexpanded, matching the reference macroexpand1 isSpecial check. - reify dropped all but the last arity of a multi-arity protocol method (spec reifies (specize* [s]) and (specize* [s _])). The macro keyed methods by name and overwrote; now it groups arities into one multi-arity fn. - reify instances did not implement IObj: with-meta threw and (instance? clojure.lang.IObj r) was false. Every Clojure reify carries metadata. with-meta now copies the reify to a fresh identity (shared method table) and keys its meta; instance? IObj/IMeta is true for any reify. This was the registry bug — spec's with-name returned nil for specs, so get-spec missed. - (set! (. Class field) val) was rejected. spec toggles clojure.lang.RT/checkSpecAsserts this way; the analyzer now lowers it to a jolt.host/set-static-field! call over a mutable-statics table, and a plain Class/field read consults that table. Also: .name/.getName on a Namespace and .ns/.sym on a Var (spec's ns-qualify / ->sym). analyzer + reify are seed sources (re-minted). spec.alpha now does valid?/conform/cat/keys/explain-str/check-asserts. tick.alpha.interval-test still needs time-literals data readers (separate).
3051 lines
401 KiB
Clojure
3051 lines
401 KiB
Clojure
[
|
|
{:suite "interop-fixes / deprecated #^ metadata reader" :label "#^ type hint on a param" :expected "\"x\"" :actual "(do (defn f1 [#^String s] s) (f1 \"x\"))"}
|
|
{:suite "interop-fixes / deprecated #^ metadata reader" :label "#^\"[B\" array hint" :expected "[1 2]" :actual "(do (defn f2 [#^\"[B\" b] b) (f2 [1 2]))"}
|
|
{:suite "interop-fixes / deprecated #^ metadata reader" :label "#^ is equivalent to ^" :expected "true" :actual "(= (meta (with-meta [] {:tag (quote String)})) {:tag (quote String)})"}
|
|
{:suite "interop-fixes / (str pattern) yields raw source" :label "str of a regex" :expected "\"abc\"" :actual "(str #\"abc\")"}
|
|
{:suite "interop-fixes / (str pattern) yields raw source" :label "compose patterns via str" :expected "true" :actual "(boolean (re-matches (re-pattern (str #\"<\" \"(.*)\" \">\")) \"<hi>\"))"}
|
|
{:suite "interop-fixes / into onto a map" :label "merges map items" :expected "true" :actual "(= {:a 1 :b 2} (into {} [{:a 1} {:b 2}]))"}
|
|
{:suite "interop-fixes / into onto a map" :label "accepts [k v] pairs" :expected "true" :actual "(= {:a 1} (into {} [[:a 1]]))"}
|
|
{:suite "interop-fixes / into onto a map" :label "map item onto empty {}" :expected "true" :actual "(= {:x 1} (into {} (list {:x 1})))"}
|
|
{:suite "interop-fixes / into onto a map" :label "conj a map onto {}" :expected "true" :actual "(= {:a 1} (conj {} {:a 1}))"}
|
|
{:suite "interop-fixes / a var is callable as its value" :label "call a var directly" :expected "42" :actual "(do (def vf (fn [x] (inc x))) ((var vf) 41))"}
|
|
{:suite "interop-fixes / a var is callable as its value" :label "var bound as a client fn" :expected "\"ok\"" :actual "(do (def base (fn [_] \"ok\")) (def mw (fn [client] (fn [req] (client req)))) ((mw (var base)) {}))"}
|
|
{:suite "control / conditionals" :label "if true" :expected "1" :actual "(if true 1 2)"}
|
|
{:suite "control / conditionals" :label "if false" :expected "2" :actual "(if false 1 2)"}
|
|
{:suite "control / conditionals" :label "if nil is false" :expected "2" :actual "(if nil 1 2)"}
|
|
{:suite "control / conditionals" :label "if no else" :expected "nil" :actual "(if false 1)"}
|
|
{:suite "control / conditionals" :label "when true" :expected "3" :actual "(when true 1 2 3)"}
|
|
{:suite "control / conditionals" :label "when false" :expected "nil" :actual "(when false 1)"}
|
|
{:suite "control / conditionals" :label "when-not" :expected "1" :actual "(when-not false 1)"}
|
|
{:suite "control / conditionals" :label "cond" :expected ":b" :actual "(cond false :a true :b :else :c)"}
|
|
{:suite "control / conditionals" :label "cond :else" :expected ":c" :actual "(cond false :a false :b :else :c)"}
|
|
{:suite "control / conditionals" :label "cond no match" :expected "nil" :actual "(cond false :a)"}
|
|
{:suite "control / conditionals" :label "condp" :expected "\"two\"" :actual "(condp = 2 1 \"one\" 2 \"two\" \"other\")"}
|
|
{:suite "control / conditionals" :label "case" :expected ":b" :actual "(case 2 1 :a 2 :b :default)"}
|
|
{:suite "control / conditionals" :label "case default" :expected ":d" :actual "(case 9 1 :a 2 :b :d)"}
|
|
{:suite "control / conditionals" :label "case multi" :expected ":ab" :actual "(case 2 (1 2) :ab 3 :c)"}
|
|
{:suite "control / conditionals" :label "case symbol const" :expected ":s" :actual "(case 'foo foo :s :default)"}
|
|
{:suite "control / conditionals" :label "case vector const" :expected ":v" :actual "(case [1 2] [1 2] :v :default)"}
|
|
{:suite "control / conditionals" :label "case map const" :expected ":m" :actual "(case {:a 1} {:a 1} :m :default)"}
|
|
{:suite "control / conditionals" :label "case list const" :expected ":l" :actual "(case '(a b) (quote (a b)) :l :default)"}
|
|
{:suite "control / conditionals" :label "case keyword" :expected ":k" :actual "(case :x :x :k :default)"}
|
|
{:suite "control / logic" :label "and all true" :expected "3" :actual "(and 1 2 3)"}
|
|
{:suite "control / logic" :label "and short circuits" :expected "nil" :actual "(and 1 nil 3)"}
|
|
{:suite "control / logic" :label "and empty" :expected "true" :actual "(and)"}
|
|
{:suite "control / logic" :label "or first truthy" :expected "1" :actual "(or nil 1 2)"}
|
|
{:suite "control / logic" :label "or all false" :expected "false" :actual "(or nil false)"}
|
|
{:suite "control / logic" :label "or empty" :expected "nil" :actual "(or)"}
|
|
{:suite "control / logic" :label "not" :expected "false" :actual "(not true)"}
|
|
{:suite "control / let & loop" :label "let" :expected "3" :actual "(let [a 1 b 2] (+ a b))"}
|
|
{:suite "control / let & loop" :label "let sequential" :expected "3" :actual "(let [a 1 b (+ a 2)] b)"}
|
|
{:suite "control / let & loop" :label "let shadowing" :expected "2" :actual "(let [a 1] (let [a 2] a))"}
|
|
{:suite "control / let & loop" :label "letfn mutual" :expected "true" :actual "(letfn [(ev? [n] (if (zero? n) true (od? (dec n)))) (od? [n] (if (zero? n) false (ev? (dec n))))] (ev? 10))"}
|
|
{:suite "control / let & loop" :label "loop/recur" :expected "15" :actual "(loop [i 1 acc 0] (if (> i 5) acc (recur (inc i) (+ acc i))))"}
|
|
{:suite "control / let & loop" :label "when-let" :expected "2" :actual "(when-let [x 1] (inc x))"}
|
|
{:suite "control / let & loop" :label "when-let nil" :expected "nil" :actual "(when-let [x nil] (inc x))"}
|
|
{:suite "control / let & loop" :label "if-let" :expected "2" :actual "(if-let [x 1] (inc x) :none)"}
|
|
{:suite "control / let & loop" :label "if-let else" :expected ":none" :actual "(if-let [x nil] (inc x) :none)"}
|
|
{:suite "control / let & loop" :label "if-some zero" :expected "1" :actual "(if-some [x 0] (inc x) :none)"}
|
|
{:suite "control / let & loop" :label "when-some nil" :expected "nil" :actual "(when-some [x nil] x)"}
|
|
{:suite "control / conditional-binding scope" :label "if-let else sees outer" :expected "5" :actual "(let [x 5] (if-let [x nil] :then x))"}
|
|
{:suite "control / conditional-binding scope" :label "if-let then binds" :expected "7" :actual "(let [x 5] (if-let [x 7] x :else))"}
|
|
{:suite "control / conditional-binding scope" :label "if-some else sees outer" :expected "5" :actual "(let [x 5] (if-some [x nil] :then x))"}
|
|
{:suite "control / conditional-binding scope" :label "if-some binds false" :expected "false" :actual "(if-some [x false] x :else)"}
|
|
{:suite "control / conditional-binding scope" :label "when-let else via or" :expected "5" :actual "(let [x 5] (or (when-let [x nil] x) x))"}
|
|
{:suite "control / conditional-binding scope" :label "when-let multi-form body" :expected "14" :actual "(when-let [x 7] (inc x) (* x 2))"}
|
|
{:suite "control / conditional-binding scope" :label "if-let in fn param" :expected "9" :actual "((fn [xs] (if-let [xs nil] :then xs)) 9)"}
|
|
{:suite "control / conditional-binding scope" :label "when-some binds zero" :expected "1" :actual "(when-some [x 0] (inc x))"}
|
|
{:suite "control / conditional-binding scope" :label "if-let evals test once" :expected "1" :actual "(let [c (atom 0)] (if-let [v (do (swap! c inc) :v)] @c :none))"}
|
|
{:suite "control / loop lowering" :label "closure captures per-iter binding" :expected "[0 1 2]" :actual "(mapv (fn [g] (g)) (loop [i 0 fs []] (if (< i 3) (recur (inc i) (conj fs (fn [] i))) fs)))"}
|
|
{:suite "control / loop lowering" :label "fib via loop" :expected "55" :actual "(loop [a 0 b 1 i 0] (if (= i 10) a (recur b (+ a b) (inc i))))"}
|
|
{:suite "control / loop lowering" :label "recur args no clobber" :expected "[2 1]" :actual "(loop [a 1 b 2 n 0] (if (= n 1) [a b] (recur b a (inc n))))"}
|
|
{:suite "control / loop lowering" :label "nested loops" :expected "9" :actual "(loop [i 0 s 0] (if (= i 3) s (recur (inc i) (loop [j 0 t s] (if (= j 3) t (recur (inc j) (inc t)))))))"}
|
|
{:suite "control / loop lowering" :label "loop sequential init" :expected "12" :actual "(loop [a 1 b (+ a 10)] (+ a b))"}
|
|
{:suite "control / loop lowering" :label "recur through let" :expected "6" :actual "(loop [i 0 acc 0] (let [x (* i 2)] (if (< i 3) (recur (inc i) (+ acc x)) acc)))"}
|
|
{:suite "control / loop lowering" :label "fn-arity recur intact" :expected "15" :actual "((fn f [n acc] (if (zero? n) acc (recur (dec n) (+ acc n)))) 5 0)"}
|
|
{:suite "control / iteration" :label "dotimes side-effect" :expected "5" :actual "(let [a (atom 0)] (dotimes [i 5] (swap! a inc)) @a)"}
|
|
{:suite "control / iteration" :label "while" :expected "5" :actual "(let [a (atom 0)] (while (< @a 5) (swap! a inc)) @a)"}
|
|
{:suite "control / iteration" :label "for" :expected "[0 1 2]" :actual "(for [x (range 3)] x)"}
|
|
{:suite "control / iteration" :label "for nested" :expected "[[0 :a] [0 :b] [1 :a] [1 :b]]" :actual "(for [x (range 2) y [:a :b]] [x y])"}
|
|
{:suite "control / iteration" :label "for :when" :expected "[0 2 4]" :actual "(for [x (range 6) :when (even? x)] x)"}
|
|
{:suite "control / iteration" :label "for :while" :expected "[0 1 2]" :actual "(for [x (range 10) :while (< x 3)] x)"}
|
|
{:suite "control / iteration" :label "for :let" :expected "[0 1 4]" :actual "(for [x (range 3) :let [sq (* x x)]] sq)"}
|
|
{:suite "control / iteration" :label "for :let+:when" :expected "[4 6 8]" :actual "(for [x (range 5) :let [y (* x 2)] :when (> y 3)] y)"}
|
|
{:suite "control / iteration" :label "for multi :when" :expected "[[1 :a] [1 :b]]" :actual "(for [x [0 1] :when (odd? x) y [:a :b]] [x y])"}
|
|
{:suite "control / iteration" :label "for destructure" :expected "[3 7]" :actual "(for [[a b] [[1 2] [3 4]]] (+ a b))"}
|
|
{:suite "control / iteration" :label "doseq side-effect" :expected "6" :actual "(let [a (atom 0)] (doseq [x [1 2 3]] (swap! a (fn [v] (+ v x)))) @a)"}
|
|
{:suite "control / iteration" :label "doseq nested" :expected "4" :actual "(let [c (atom 0)] (doseq [x [1 2] y [10 20]] (swap! c inc)) @c)"}
|
|
{:suite "control / iteration" :label "doseq :when" :expected "[1 3]" :actual "(let [a (atom [])] (doseq [x [1 2 3] :when (odd? x)] (swap! a conj x)) @a)"}
|
|
{:suite "control / iteration" :label "doseq :while" :expected "6" :actual "(let [a (atom 0)] (doseq [x (range 10) :while (< x 4)] (swap! a + x)) @a)"}
|
|
{:suite "control / iteration" :label "doseq :let" :expected "[0 1 4]" :actual "(let [a (atom [])] (doseq [x (range 3) :let [sq (* x x)]] (swap! a conj sq)) @a)"}
|
|
{:suite "control / iteration" :label "doseq returns nil" :expected "nil" :actual "(doseq [x [1 2 3]] x)"}
|
|
{:suite "control / threading" :label "->" :expected "6" :actual "(-> 1 inc (+ 4))"}
|
|
{:suite "control / threading" :label "-> with forms" :expected "[1 2 3]" :actual "(-> [] (conj 1) (conj 2) (conj 3))"}
|
|
{:suite "control / threading" :label "->>" :expected "9" :actual "(->> [1 2 3] (map inc) (reduce +))"}
|
|
{:suite "control / threading" :label "as->" :expected "2" :actual "(as-> [0 1] x (map inc x) (reverse x) (first x))"}
|
|
{:suite "control / threading" :label "some->" :expected "2" :actual "(some-> 1 inc)"}
|
|
{:suite "control / threading" :label "some-> nil stops" :expected "nil" :actual "(some-> nil inc)"}
|
|
{:suite "control / threading" :label "some->>" :expected "[2 3]" :actual "(some->> [1 2] (map inc))"}
|
|
{:suite "control / threading" :label "cond->" :expected "2" :actual "(cond-> 1 true inc false inc)"}
|
|
{:suite "control / threading" :label "cond->>" :expected "[1 2]" :actual "(cond->> [2] true (cons 1))"}
|
|
{:suite "control / threading" :label "doto returns subject" :expected "5" :actual "(let [a (doto (atom 0) (reset! 5))] @a)"}
|
|
{:suite "deftype / custom toString" :label ".toString uses the method" :expected "\"hi\"" :actual "(do (deftype Foo [s] Object (toString [_] s)) (.toString (->Foo \"hi\")))"}
|
|
{:suite "deftype / custom toString" :label "str uses the method" :expected "\"hi\"" :actual "(do (deftype Foo [s] Object (toString [_] s)) (str (->Foo \"hi\")))"}
|
|
{:suite "deftype / custom toString" :label "str concatenation uses it" :expected "\"<hi>\"" :actual "(do (deftype Foo [s] Object (toString [_] s)) (str \"<\" (->Foo \"hi\") \">\"))"}
|
|
{:suite "deftype / custom toString" :label "computed toString" :expected "\"v=7\"" :actual "(do (deftype Boxed [v] Object (toString [_] (str \"v=\" v))) (str (->Boxed 7)))"}
|
|
{:suite "deftype / custom toString" :label "defrecord without toString keeps repr" :expected "true" :actual "(do (defrecord Bar [x]) (boolean (re-find #\"Bar\" (str (->Bar 1)))))"}
|
|
{:suite "deftype / custom toString" :label "pr-str of a defrecord is the repr" :expected "true" :actual "(do (defrecord Baz [x]) (boolean (re-find #\"\\{\" (pr-str (->Baz 1)))))"}
|
|
{:suite "destructure / sequential" :label "basic vector" :expected "3" :actual "(let [[a b] [1 2]] (+ a b))"}
|
|
{:suite "destructure / sequential" :label "skip with _" :expected "3" :actual "(let [[_ b] [1 2]] (+ b 1))"}
|
|
{:suite "destructure / sequential" :label "rest with &" :expected "[3 4]" :actual "(let [[a & more] [1 3 4]] more)"}
|
|
{:suite "destructure / sequential" :label ":as whole" :expected "[1 2]" :actual "(let [[a :as v] [1 2]] v)"}
|
|
{:suite "destructure / sequential" :label "nested" :expected "3" :actual "(let [[[a b]] [[1 2]]] (+ a b))"}
|
|
{:suite "destructure / sequential" :label "fewer values nil" :expected "nil" :actual "(let [[a b c] [1 2]] c)"}
|
|
{:suite "destructure / sequential" :label "over a list" :expected "1" :actual "(let [[a] (list 1 2)] a)"}
|
|
{:suite "destructure / sequential" :label "over a seq" :expected "2" :actual "(let [[a b] (rest [9 1 2])] b)"}
|
|
{:suite "destructure / sequential" :label "string chars" :expected "\\a" :actual "(let [[a] (seq \"ab\")] a)"}
|
|
{:suite "destructure / associative" :label "keys" :expected "3" :actual "(let [{:keys [a b]} {:a 1 :b 2}] (+ a b))"}
|
|
{:suite "destructure / associative" :label ":as map" :expected "{:a 1}" :actual "(let [{:as m} {:a 1}] m)"}
|
|
{:suite "destructure / associative" :label ":or default" :expected "9" :actual "(let [{:keys [a] :or {a 9}} {}] a)"}
|
|
{:suite "destructure / associative" :label ":or present" :expected "1" :actual "(let [{:keys [a] :or {a 9}} {:a 1}] a)"}
|
|
{:suite "destructure / associative" :label "explicit binding" :expected "1" :actual "(let [{x :a} {:a 1}] x)"}
|
|
{:suite "destructure / associative" :label "nested map" :expected "2" :actual "(let [{{b :b} :a} {:a {:b 2}}] b)"}
|
|
{:suite "destructure / associative" :label "keys + as" :expected "[1 {:a 1}]" :actual "(let [{:keys [a] :as m} {:a 1}] [a m])"}
|
|
{:suite "destructure / associative" :label "map in vector" :expected "1" :actual "(let [[{:keys [a]}] [{:a 1}]] a)"}
|
|
{:suite "destructure / in forms" :label "fn params" :expected "3" :actual "((fn [[a b]] (+ a b)) [1 2])"}
|
|
{:suite "destructure / in forms" :label "fn map param" :expected "1" :actual "((fn [{:keys [a]}] a) {:a 1})"}
|
|
{:suite "destructure / in forms" :label "defn destructure" :expected "3" :actual "(do (defn f [[a b]] (+ a b)) (f [1 2]))"}
|
|
{:suite "destructure / in forms" :label "loop destructure" :expected "3" :actual "(loop [[a b] [1 2]] (+ a b))"}
|
|
{:suite "destructure / in forms" :label "doseq destructure" :expected "12" :actual "(let [s (atom 0)] (doseq [[k v] {:a 4 :b 8}] (swap! s (fn [x] (+ x v)))) @s)"}
|
|
{:suite "destructure / in forms" :label "for destructure" :expected "[3 7]" :actual "(for [[a b] [[1 2] [3 4]]] (+ a b))"}
|
|
{:suite "destructure / in forms" :label "& rest in fn" :expected "[2 3]" :actual "((fn [a & more] more) 1 2 3)"}
|
|
{:suite "destructure / associative extras" :label ":strs" :expected "7" :actual "(let [{:strs [a]} {\"a\" 7}] a)"}
|
|
{:suite "destructure / associative extras" :label ":syms" :expected "8" :actual "(let [{:syms [a]} {(quote a) 8}] a)"}
|
|
{:suite "destructure / associative extras" :label "namespaced :keys" :expected "3" :actual "(let [{:keys [x/y]} {:x/y 3}] y)"}
|
|
{:suite "destructure / associative extras" :label "namespaced :syms" :expected "4" :actual "(let [{:syms [p/q]} {(quote p/q) 4}] q)"}
|
|
{:suite "destructure / associative extras" :label "keyword :keys" :expected "3" :actual "(let [{:keys [:a :b]} {:a 1 :b 2}] (+ a b))"}
|
|
{:suite "destructure / associative extras" :label "keyword :keys ns" :expected "3" :actual "(let [{:keys [:x/y]} {:x/y 3}] y)"}
|
|
{:suite "destructure / keyword args (& {:keys})" :label "fn kwargs" :expected "[1 2]" :actual "(do (defn f [& {:keys [a b]}] [a b]) (f :a 1 :b 2))"}
|
|
{:suite "destructure / keyword args (& {:keys})" :label "fn kwargs + fixed" :expected "[0 5]" :actual "(do (defn g [x & {:keys [a]}] [x a]) (g 0 :a 5))"}
|
|
{:suite "destructure / keyword args (& {:keys})" :label "fn kwargs :or" :expected "9" :actual "(do (defn h [& {:keys [a] :or {a 9}}] a) (h))"}
|
|
{:suite "destructure / keyword args (& {:keys})" :label "fn kwargs trailing map" :expected "7" :actual "(do (defn k [& {:keys [a]}] a) (k {:a 7}))"}
|
|
{:suite "destructure / fn params & loop" :label "fn vector param" :expected "7" :actual "((fn [[a b]] (+ a b)) [3 4])"}
|
|
{:suite "destructure / fn params & loop" :label "fn map param" :expected "30" :actual "((fn [{:keys [x y]}] (* x y)) {:x 5 :y 6})"}
|
|
{:suite "destructure / fn params & loop" :label "fn :or param" :expected "7" :actual "((fn [{:keys [x] :or {x 7}}] x) {})"}
|
|
{:suite "destructure / fn params & loop" :label "fn multi-arity destr" :expected "15" :actual "((fn ([[a]] a) ([[a] b] (+ a b))) [10] 5)"}
|
|
{:suite "destructure / fn params & loop" :label "loop vector binding" :expected "[4 2]" :actual "(loop [[a b] [1 2] n 0] (if (< n 3) (recur [(inc a) b] (inc n)) [a b]))"}
|
|
{:suite "destructure / fn params & loop" :label "loop map binding" :expected "4" :actual "(loop [{:keys [v]} {:v 1} n 0] (if (< n 2) (recur {:v (* v 2)} (inc n)) v))"}
|
|
{:suite "destructure / fn params & loop" :label "loop init sees destr" :expected "[1 2 3]" :actual "(loop [[a b] [1 2] c (+ a b)] [a b c])"}
|
|
{:suite "destructure / primitives reject patterns" :label "fn* fixed pattern" :expected :throws :actual "((fn* [[a b]] a) [1 2])"}
|
|
{:suite "destructure / primitives reject patterns" :label "fn* rest pattern" :expected :throws :actual "((fn* [a & [b]] b) 1 2 3)"}
|
|
{:suite "destructure / primitives reject patterns" :label "let* pattern" :expected :throws :actual "(let* [[a b] [1 2]] a)"}
|
|
{:suite "destructure / primitives reject patterns" :label "loop* pattern" :expected :throws :actual "(loop* [[a b] [1 2]] a)"}
|
|
{:suite "destructure / primitives reject patterns" :label "fn desugars" :expected "[1 2]" :actual "((fn [[a b]] [a b]) [1 2])"}
|
|
{:suite "destructure / primitives reject patterns" :label "let desugars" :expected "[1 2]" :actual "(let [[a b] [1 2]] [a b])"}
|
|
{:suite "destructure / macro params" :label "macro & [a & more :as all]" :expected "[1 [2 3] [1 2 3]]" :actual "(do (defmacro m [& [a & more :as all]] (list (quote quote) [a (vec more) (vec all)])) (m 1 2 3))"}
|
|
{:suite "destructure / macro params" :label "macro fixed destructure" :expected "[2 1]" :actual "(do (defmacro mm [[a b]] (list (quote quote) [b a])) (mm [1 2]))"}
|
|
{:suite "destructure / macro params" :label "macro & {:keys}" :expected "5" :actual "(do (defmacro mk [& {:keys [x]}] (list (quote quote) x)) (mk :x 5))"}
|
|
{:suite "exceptions / try-catch" :label "catch :default" :expected ":caught" :actual "(try (throw (ex-info \"boom\" {})) (catch :default e :caught))"}
|
|
{:suite "exceptions / try-catch" :label "catch by class" :expected ":caught" :actual "(try (throw (ex-info \"boom\" {})) (catch Exception e :caught))"}
|
|
{:suite "exceptions / try-catch" :label "catch binds error" :expected "\"boom\"" :actual "(try (throw (ex-info \"boom\" {})) (catch :default e (ex-message e)))"}
|
|
{:suite "exceptions / try-catch" :label "no throw -> body" :expected "1" :actual "(try 1 (catch :default e :caught))"}
|
|
{:suite "exceptions / try-catch" :label "finally runs on ok" :expected "2" :actual "(let [a (atom 0)] (try 2 (finally (reset! a 9))) )"}
|
|
{:suite "exceptions / try-catch" :label "finally runs on throw" :expected "9" :actual "(let [a (atom 0)] (try (throw (ex-info \"x\" {})) (catch :default e nil) (finally (reset! a 9))) @a)"}
|
|
{:suite "exceptions / try-catch" :label "catch value of body" :expected "5" :actual "(try (+ 2 3) (catch :default e 0))"}
|
|
{:suite "exceptions / try-catch" :label "malformed catch: non-symbol binding" :expected :throws :actual "(try 1 (catch e (* e 10)))"}
|
|
{:suite "exceptions / try-catch" :label "malformed catch: literal binding" :expected :throws :actual "(try 1 (catch e 5))"}
|
|
{:suite "exceptions / try-catch" :label "malformed catch: too short" :expected :throws :actual "(try 1 (catch Exception))"}
|
|
{:suite "exceptions / assert" :label "assert true -> ok" :expected ":ok" :actual "(do (assert true) :ok)"}
|
|
{:suite "exceptions / assert" :label "assert expr -> ok" :expected ":ok" :actual "(do (assert (= 1 1)) :ok)"}
|
|
{:suite "exceptions / assert" :label "assert false throws" :expected :throws :actual "(assert false)"}
|
|
{:suite "exceptions / assert" :label "assert nil throws" :expected :throws :actual "(assert nil)"}
|
|
{:suite "exceptions / ex-info" :label "ex-message" :expected "\"oops\"" :actual "(ex-message (ex-info \"oops\" {}))"}
|
|
{:suite "exceptions / ex-info" :label "ex-data" :expected "{:k 1}" :actual "(ex-data (ex-info \"oops\" {:k 1}))"}
|
|
{:suite "exceptions / ex-info" :label "ex-data via catch" :expected "{:code 42}" :actual "(try (throw (ex-info \"e\" {:code 42})) (catch :default e (ex-data e)))"}
|
|
{:suite "exceptions / ex-info" :label "ex-cause" :expected "true" :actual "(let [c (ex-info \"root\" {})] (= c (ex-cause (ex-info \"outer\" {} c))))"}
|
|
{:suite "exceptions / ex-info" :label "propagates to outer" :expected "\"inner\"" :actual "(try (try (throw (ex-info \"inner\" {})) (finally nil)) (catch :default e (ex-message e)))"}
|
|
{:suite "exceptions / ex-info" :label "catch binds thrown value" :expected "42" :actual "(try (throw 42) (catch :default e e))"}
|
|
{:suite "exceptions / ex-info" :label "rethrow preserves ex" :expected "\"inner\"" :actual "(try (try (throw (ex-info \"inner\" {})) (catch :default e (throw e))) (catch :default e (ex-message e)))"}
|
|
{:suite "exceptions / ex-info" :label "ex-data on non-ex" :expected "nil" :actual "(ex-data 42)"}
|
|
{:suite "exceptions / ex-info" :label "ex-cause on non-ex" :expected "nil" :actual "(ex-cause {:k 1})"}
|
|
{:suite "exceptions / ex-info" :label "ex-message of string" :expected "nil" :actual "(ex-message \"hi\")"}
|
|
{:suite "forms / case" :label "bool" :expected ":yes" :actual "(case true true :yes false :no :default)"}
|
|
{:suite "forms / case" :label "keyword match" :expected ":b" :actual "(case :a :x :wrong :a :b :default)"}
|
|
{:suite "forms / case" :label "number match" :expected ":two" :actual "(case 2 1 :one 2 :two :default)"}
|
|
{:suite "forms / case" :label "string match" :expected ":hit" :actual "(case \"x\" \"y\" :miss \"x\" :hit :default)"}
|
|
{:suite "forms / case" :label "nil match" :expected ":nada" :actual "(case nil nil :nada :default)"}
|
|
{:suite "forms / case" :label "default" :expected ":def" :actual "(case 99 1 :one 2 :two :def)"}
|
|
{:suite "forms / case" :label "list of consts" :expected ":vowel" :actual "(case \\a (\\a \\e \\i \\o \\u) :vowel :consonant)"}
|
|
{:suite "forms / case" :label "no match no default" :expected :throws :actual "(case 5 1 :one)"}
|
|
{:suite "forms / case" :label "duplicate keys" :expected :throws :actual "(case 1 1 :one 1 :dup :default)"}
|
|
{:suite "forms / case" :label "duplicate in or-group" :expected :throws :actual "(case 2 (1 2) :a (2 3) :b :default)"}
|
|
{:suite "forms / fn" :label "named fn nil" :expected "nil" :actual "((fn* foo-bar []))"}
|
|
{:suite "forms / fn" :label "immediate call" :expected "1" :actual "((fn* [] 1))"}
|
|
{:suite "forms / fn" :label "args" :expected "[:a :b]" :actual "((fn* [a b] [a b]) :a :b)"}
|
|
{:suite "forms / fn" :label "multi-arity 0" :expected "0" :actual "(do (def add (fn* ([] 0) ([a] a) ([a b] (+ a b)))) (add))"}
|
|
{:suite "forms / fn" :label "multi-arity 1" :expected "-500" :actual "(do (def add (fn* ([] 0) ([a] a) ([a b] (+ a b)))) (add -500))"}
|
|
{:suite "forms / fn" :label "multi-arity 2" :expected "-450" :actual "(do (def add (fn* ([] 0) ([a] a) ([a b] (+ a b)))) (add -500 50))"}
|
|
{:suite "forms / fn" :label "variadic rest" :expected "[3 4]" :actual "(do (def v (fn* ([a b & args] args) ([] 0))) (v 1 2 3 4))"}
|
|
{:suite "forms / fn" :label "variadic empty" :expected "0" :actual "(do (def v (fn* ([a b & args] args) ([] 0))) (v))"}
|
|
{:suite "forms / fn" :label "variadic collect" :expected "[{} nil :m]" :actual "((fn* [a b & args] args) 'w 't {} nil :m)"}
|
|
{:suite "forms / fn" :label "closure capture" :expected "8" :actual "(do (def adder (fn* [n] (fn* [x] (+ x n)))) ((adder 5) 3))"}
|
|
{:suite "forms / fn" :label "recur countdown" :expected "0" :actual "(do (def cd (fn* [n] (if (< 0 n) (recur (+ n -1)) n))) (cd 10))"}
|
|
{:suite "forms / fn" :label "named self-recur" :expected "120" :actual "(do (def f (fn* fact [n] (if (= n 0) 1 (* n (fact (dec n)))))) (f 5))"}
|
|
{:suite "forms / fn" :label "no param vector" :expected :throws :actual "(fn* foo)"}
|
|
{:suite "forms / fn" :label "non-symbol param" :expected :throws :actual "(fn* [1] 1)"}
|
|
{:suite "forms / let" :label "literal" :expected "1" :actual "(let* [a 1] a)"}
|
|
{:suite "forms / let" :label "multiple" :expected "[1 2]" :actual "(let* [a 1 b 2] [a b])"}
|
|
{:suite "forms / let" :label "previous ref" :expected ":bee" :actual "(let* [a 1 b (if (= 1 a) :bee :uh-oh)] b)"}
|
|
{:suite "forms / let" :label "nested let" :expected "3" :actual "(let* [a 5 b (let* [c -2] (+ a c))] b)"}
|
|
{:suite "forms / let" :label "fn value bound" :expected "\":foo\"" :actual "(let* [kw->str (fn* [kw] (str kw))] (kw->str :foo))"}
|
|
{:suite "forms / let" :label "shadowing" :expected "2" :actual "(let* [a 1 a 2] a)"}
|
|
{:suite "forms / letfn" :label "mutual top" :expected "[1 2]" :actual "(letfn [(a [] 1) (b [] 2)] [(a) (b)])"}
|
|
{:suite "forms / letfn" :label "mutual recursion" :expected ":done" :actual "(letfn [(ev? [n] (if (= 0 n) :done (od? (dec n)))) (od? [n] (ev? n))] (ev? 4))"}
|
|
{:suite "forms / letfn" :label "nested letfn" :expected "3" :actual "(letfn [(a [] 5) (b [] (letfn [(c [] -2)] (+ (a) (c))))] (b))"}
|
|
{:suite "forms / loop" :label "sum" :expected "55" :actual "(loop* [sum 0 cnt 10] (if (= cnt 0) sum (recur (+ cnt sum) (dec cnt))))"}
|
|
{:suite "forms / loop" :label "multi binding" :expected "[4 2]" :actual "(loop* [a 1 b 2 n 0] (if (< n 3) (recur (inc a) b (inc n)) [a b]))"}
|
|
{:suite "forms / loop" :label "init sees prior" :expected "[1 2 3]" :actual "(loop* [a 1 b (+ a 1) c (+ b 1)] [a b c])"}
|
|
{:suite "forms / try" :label "immediate throw caught" :expected ":caught" :actual "(try (throw :boom) (catch :default e :caught))"}
|
|
{:suite "forms / try" :label "first throw wins" :expected "\"a\"" :actual "(try (throw (ex-info \"a\" {})) (throw (ex-info \"b\" {})) (catch :default e (ex-message e)))"}
|
|
{:suite "forms / try" :label "catch ex-data" :expected "7" :actual "(try (throw (ex-info \"e\" {:v 7})) (catch :default e (:v (ex-data e))))"}
|
|
{:suite "forms / try" :label "finally runs" :expected "9" :actual "(let [a (atom 0)] (try 1 (finally (reset! a 9))) @a)"}
|
|
{:suite "forms / try" :label "body value w/ finally" :expected "1" :actual "(try 1 (finally 2))"}
|
|
{:suite "forms / try" :label "catch value w/ finally" :expected ":h" :actual "(try (throw (ex-info \"x\" {})) (catch :default e :h) (finally :ignored))"}
|
|
{:suite "forms / try" :label "no throw skips catch" :expected "5" :actual "(try 5 (catch :default e :nope))"}
|
|
{:suite "forms / if-do-def-call" :label "if truthy vec" :expected ":fine" :actual "(if [:ok] :fine :no)"}
|
|
{:suite "forms / if-do-def-call" :label "if truthy str" :expected ":fine" :actual "(if \"good?\" :fine :no)"}
|
|
{:suite "forms / if-do-def-call" :label "if nil = false" :expected ":else" :actual "(if nil :then :else)"}
|
|
{:suite "forms / if-do-def-call" :label "if no else" :expected "nil" :actual "(if false 1)"}
|
|
{:suite "forms / if-do-def-call" :label "do nested" :expected "1" :actual "(do (do (do (do 1))))"}
|
|
{:suite "forms / if-do-def-call" :label "do returns last" :expected "3" :actual "(do 1 2 3)"}
|
|
{:suite "forms / if-do-def-call" :label "def + deref var" :expected "true" :actual "(var? (def one 1))"}
|
|
{:suite "forms / if-do-def-call" :label "def no init interns var" :expected "true" :actual "(var? (def no-init))"}
|
|
{:suite "forms / if-do-def-call" :label "def no init keeps existing root" :expected "7" :actual "(do (def kept 7) (def kept) kept)"}
|
|
{:suite "forms / if-do-def-call" :label "declare interns var" :expected "true" :actual "(do (declare fwd-declared) (var? (var fwd-declared)))"}
|
|
{:suite "forms / if-do-def-call" :label "def redefine" :expected "100" :actual "(do (def one 1) (def one 100) one)"}
|
|
{:suite "forms / if-do-def-call" :label "def in fn mutates" :expected "[:default :meow]" :actual "(do (def a :default) (def set-a (fn* [v] (def a v))) (let* [before a] (set-a :meow) [before a]))"}
|
|
{:suite "forms / if-do-def-call" :label "call literal fn" :expected "1" :actual "((fn* [] 1))"}
|
|
{:suite "forms / if-do-def-call" :label "call nested" :expected "6" :actual "(+ ((fn* [] 1)) ((fn* [] 2)) ((fn* [] 3)))"}
|
|
{:suite "forms / if-do-def-call" :label "call nil" :expected :throws :actual "(nil)"}
|
|
{:suite "forms / if arity (X1)" :label "bare if throws" :expected :throws :actual "(if)"}
|
|
{:suite "forms / if arity (X1)" :label "one-arg if throws" :expected :throws :actual "(if true)"}
|
|
{:suite "forms / if arity (X1)" :label "four-arg if throws" :expected :throws :actual "(if true 1 2 3)"}
|
|
{:suite "forms / if arity (X1)" :label "two-arg if ok" :expected "nil" :actual "(if false 1)"}
|
|
{:suite "forms / if arity (X1)" :label "three-arg if ok" :expected "2" :actual "(if false 1 2)"}
|
|
{:suite "functions / definition" :label "fn literal" :expected "3" :actual "((fn [a b] (+ a b)) 1 2)"}
|
|
{:suite "functions / definition" :label "fn shorthand" :expected "3" :actual "(#(+ %1 %2) 1 2)"}
|
|
{:suite "functions / definition" :label "fn shorthand %" :expected "2" :actual "(#(inc %) 1)"}
|
|
{:suite "functions / definition" :label "defn" :expected "5" :actual "(do (defn f [x] (+ x 2)) (f 3))"}
|
|
{:suite "functions / definition" :label "multi-arity" :expected "[1 5]" :actual "(do (defn f ([x] x) ([x y] (+ x y))) [(f 1) (f 2 3)])"}
|
|
{:suite "functions / definition" :label "variadic" :expected "[1 2 3]" :actual "(do (defn f [& xs] xs) (f 1 2 3))"}
|
|
{:suite "functions / definition" :label "variadic with fixed" :expected "[1 [2 3]]" :actual "(do (defn f [a & xs] [a xs]) (f 1 2 3))"}
|
|
{:suite "functions / definition" :label "closure captures" :expected "8" :actual "(do (defn adder [n] (fn [x] (+ x n))) ((adder 5) 3))"}
|
|
{:suite "functions / definition" :label "recursion" :expected "120" :actual "(do (defn fact [n] (if (< n 2) 1 (* n (fact (dec n))))) (fact 5))"}
|
|
{:suite "functions / definition" :label "named fn self-ref" :expected "120" :actual "((fn fact [n] (if (< n 2) 1 (* n (fact (dec n))))) 5)"}
|
|
{:suite "functions / definition" :label "param named `in`" :expected "1" :actual "((fn [in] (first in)) [1 2 3])"}
|
|
{:suite "functions / definition" :label "param `in` via core fn" :expected "3" :actual "((fn [in] (count in)) [1 2 3])"}
|
|
{:suite "functions / definition" :label "local `in` in let body" :expected "2" :actual "(let [in [2 3]] (first in))"}
|
|
{:suite "functions / application" :label "apply" :expected "6" :actual "(apply + [1 2 3])"}
|
|
{:suite "functions / application" :label "apply with leading" :expected "10" :actual "(apply + 1 2 [3 4])"}
|
|
{:suite "functions / application" :label "apply keyword" :expected "1" :actual "(apply :a [{:a 1}])"}
|
|
{:suite "functions / application" :label "partial" :expected "7" :actual "((partial + 5) 2)"}
|
|
{:suite "functions / application" :label "partial multi" :expected "10" :actual "((partial + 1 2) 3 4)"}
|
|
{:suite "functions / application" :label "comp" :expected "4" :actual "((comp inc inc) 2)"}
|
|
{:suite "functions / application" :label "comp order" :expected "5" :actual "((comp inc (fn [x] (* x 2))) 2)"}
|
|
{:suite "functions / application" :label "comp identity" :expected "3" :actual "((comp) 3)"}
|
|
{:suite "functions / application" :label "complement" :expected "true" :actual "((complement even?) 3)"}
|
|
{:suite "functions / application" :label "constantly" :expected "5" :actual "((constantly 5) 1 2 3)"}
|
|
{:suite "functions / application" :label "identity" :expected "7" :actual "(identity 7)"}
|
|
{:suite "functions / combinators" :label "juxt" :expected "[1 3]" :actual "((juxt first last) [1 2 3])"}
|
|
{:suite "functions / combinators" :label "fnil" :expected "1" :actual "((fnil inc 0) nil)"}
|
|
{:suite "functions / combinators" :label "fnil passes value" :expected "6" :actual "((fnil inc 0) 5)"}
|
|
{:suite "functions / combinators" :label "every-pred true" :expected "true" :actual "((every-pred pos? even?) 4)"}
|
|
{:suite "functions / combinators" :label "every-pred false" :expected "false" :actual "((every-pred pos? even?) 3)"}
|
|
{:suite "functions / combinators" :label "some-fn" :expected "true" :actual "((some-fn even? neg?) 3 4)"}
|
|
{:suite "functions / combinators" :label "memoize" :expected "2" :actual "(do (def c (atom 0)) (def f (memoize (fn [x] (swap! c inc) x))) (f 1) (f 1) (f 2) @c)"}
|
|
{:suite "functions / combinators" :label "trampoline" :expected "10" :actual "(trampoline (fn f [n acc] (if (zero? n) acc (fn [] (f (dec n) (+ acc 2))))) 5 0)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "complement true" :expected "true" :actual "((complement pos?) -1)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "complement false" :expected "false" :actual "((complement pos?) 1)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "complement multi" :expected "true" :actual "((complement <) 3 2)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "fnil patches nil" :expected "1" :actual "((fnil inc 0) nil)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "fnil passes non-nil" :expected "6" :actual "((fnil inc 0) 5)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "fnil two defaults" :expected "8" :actual "((fnil + 1 2) nil nil 5)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "fnil only first 3" :expected "[:a :b :c nil]" :actual "((fnil vector :a :b :c) nil nil nil nil)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "fnil in update" :expected "{:k 1}" :actual "(update {} :k (fnil inc 0))"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "clojure-version" :expected "true" :actual "(string? (clojure-version))"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "bigdec" :expected "3M" :actual "(bigdec 3)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "numerator throws" :expected :throws :actual "(numerator 1)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "denominator throws" :expected :throws :actual "(denominator 1)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "supers empty set" :expected "#{}" :actual "(supers 1)"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "munge dashes" :expected "\"a_b\"" :actual "(munge \"a-b\")"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "munge symbol" :expected "(quote x_y)" :actual "(munge (quote x-y))"}
|
|
{:suite "clojure.core / leaf batch (complement fnil munge etc.)" :label "test no-test" :expected ":no-test" :actual "(test (quote foo))"}
|
|
{:suite "clojure.core / leaf batch 2" :label "key" :expected "1" :actual "(key (first {1 :a}))"}
|
|
{:suite "clojure.core / leaf batch 2" :label "val" :expected ":a" :actual "(val (first {1 :a}))"}
|
|
{:suite "clojure.core / leaf batch 2" :label "key non-entry throws" :expected :throws :actual "(key 5)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "find hit" :expected "[:a 1]" :actual "(find {:a 1} :a)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "find miss" :expected "nil" :actual "(find {:a 1} :b)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "find nil value" :expected "[:a nil]" :actual "(find {:a nil} :a)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "find on vector" :expected "[0 :x]" :actual "(find [:x :y] 0)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "select-keys" :expected "{:a 1}" :actual "(select-keys {:a 1 :b 2} [:a])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "select-keys nil val" :expected "{:a nil}" :actual "(select-keys {:a nil :b 2} [:a])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "select-keys missing" :expected "{}" :actual "(select-keys {:a 1} [:z])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "zipmap" :expected "{:a 1, :b 2}" :actual "(zipmap [:a :b] [1 2])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "zipmap uneven" :expected "{:a 1}" :actual "(zipmap [:a :b] [1])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "zipmap nil val" :expected "{:a nil}" :actual "(zipmap [:a] [nil])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge" :expected "{:a 1, :b 2}" :actual "(merge {:a 1} {:b 2})"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge later wins" :expected "{:a 2}" :actual "(merge {:a 1} {:a 2})"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge nil arg" :expected "{:a 1}" :actual "(merge {:a 1} nil)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge nil first" :expected "{:a 1}" :actual "(merge nil {:a 1})"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge all nil" :expected "nil" :actual "(merge nil nil)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge empty" :expected "nil" :actual "(merge)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge entry pair" :expected "{:a 1, :b 2}" :actual "(merge {:a 1} [:b 2])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge-with" :expected "{:a 3}" :actual "(merge-with + {:a 1} {:a 2})"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge-with disjoint" :expected "{:a 1, :b 2}" :actual "(merge-with + {:a 1} {:b 2})"}
|
|
{:suite "clojure.core / leaf batch 2" :label "merge-with nil-val present" :expected "{:a 1}" :actual "(merge-with (fn [a b] (or a b)) {:a nil} {:a 1})"}
|
|
{:suite "clojure.core / leaf batch 2" :label "get-in" :expected "1" :actual "(get-in {:a {:b 1}} [:a :b])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "get-in missing" :expected ":nf" :actual "(get-in {:a 1} [:z :y] :nf)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "get-in nil value present" :expected "nil" :actual "(get-in {:a {:b nil}} [:a :b] :nf)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "get-in empty path" :expected "{:a 1}" :actual "(get-in {:a 1} [])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "memoize" :expected "2" :actual "(do (def c (atom 0)) (def f (memoize (fn [x] (swap! c inc) x))) (f 1) (f 1) (f 2) (deref c))"}
|
|
{:suite "clojure.core / leaf batch 2" :label "memoize caches nil" :expected "1" :actual "(do (def c (atom 0)) (def f (memoize (fn [x] (swap! c inc) nil))) (f 1) (f 1) (deref c))"}
|
|
{:suite "clojure.core / leaf batch 2" :label "partial" :expected "6" :actual "((partial + 1 2) 3)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "partial no extra" :expected "3" :actual "((partial + 1 2))"}
|
|
{:suite "clojure.core / leaf batch 2" :label "partial many fixed" :expected "15" :actual "((partial + 1 2 3 4) 5)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "trampoline" :expected "10" :actual "(trampoline (fn f [n acc] (if (zero? n) acc (fn [] (f (dec n) (+ acc 2))))) 5 0)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "some? true" :expected "true" :actual "(some? 0)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "some? false" :expected "false" :actual "(some? nil)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "true?/false?" :expected "[true false false]" :actual "[(true? true) (true? 1) (false? nil)]"}
|
|
{:suite "clojure.core / leaf batch 2" :label "max" :expected "3" :actual "(max 1 3 2)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "min" :expected "1" :actual "(min 3 1 2)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "max single" :expected "5" :actual "(max 5)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "max non-number throws" :expected :throws :actual "(max 1 :a)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "reverse" :expected "[3 2 1]" :actual "(reverse [1 2 3])"}
|
|
{:suite "clojure.core / leaf batch 2" :label "reverse empty" :expected "[]" :actual "(reverse nil)"}
|
|
{:suite "clojure.core / leaf batch 2" :label "conj nil onto map" :expected "{:a 1}" :actual "(conj {:a 1} nil)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "empty vector" :expected "[]" :actual "(empty [1 2])"}
|
|
{:suite "clojure.core / leaf batch 3" :label "empty list" :expected "[]" :actual "(empty (list 1))"}
|
|
{:suite "clojure.core / leaf batch 3" :label "empty map" :expected "{}" :actual "(empty {:a 1})"}
|
|
{:suite "clojure.core / leaf batch 3" :label "empty set" :expected "#{}" :actual "(empty #{1})"}
|
|
{:suite "clojure.core / leaf batch 3" :label "empty nil" :expected "nil" :actual "(empty nil)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "empty string" :expected "nil" :actual "(empty \"abc\")"}
|
|
{:suite "clojure.core / leaf batch 3" :label "empty lazy is ()" :expected "[]" :actual "(empty (map inc [1 2]))"}
|
|
{:suite "clojure.core / leaf batch 3" :label "empty sorted keeps cmp" :expected "[3 1]" :actual "(vec (seq (into (empty (sorted-set-by > 1 2)) [1 3])))"}
|
|
{:suite "clojure.core / leaf batch 3" :label "assoc-in" :expected "{:a {:b 1}}" :actual "(assoc-in {} [:a :b] 1)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "assoc-in deep" :expected "{:a {:b {:c 2}}}" :actual "(assoc-in {:a {:b {:c 1}}} [:a :b :c] 2)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "assoc-in keeps siblings" :expected "{:a {:b 1, :c 2}}" :actual "(assoc-in {:a {:b 1}} [:a :c] 2)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "assoc-in vector idx" :expected "[1 9]" :actual "(assoc-in [1 2] [1] 9)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "assoc-in nested vec" :expected "[{:a 9}]" :actual "(assoc-in [{:a 1}] [0 :a] 9)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "update-in" :expected "{:a {:b 2}}" :actual "(update-in {:a {:b 1}} [:a :b] inc)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "update-in extra args" :expected "{:a {:b 111}}" :actual "(update-in {:a {:b 1}} [:a :b] + 10 100)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "update-in fnil" :expected "{:a {:b 1}}" :actual "(update-in {} [:a :b] (fnil inc 0))"}
|
|
{:suite "clojure.core / leaf batch 3" :label "update-in single key" :expected "{:a 2}" :actual "(update-in {:a 1} [:a] inc)"}
|
|
{:suite "clojure.core / leaf batch 3" :label "interpose" :expected "[1 :s 2 :s 3]" :actual "(interpose :s [1 2 3])"}
|
|
{:suite "clojure.core / leaf batch 3" :label "interpose empty" :expected "[]" :actual "(interpose :s [])"}
|
|
{:suite "clojure.core / leaf batch 3" :label "interpose one" :expected "[1]" :actual "(interpose :s [1])"}
|
|
{:suite "clojure.core / leaf batch 3" :label "interpose is lazy" :expected "[0 :s 1]" :actual "(take 3 (interpose :s (range)))"}
|
|
{:suite "clojure.core / leaf batch 3" :label "interpose xform" :expected "[\"a\" \",\" \"b\"]" :actual "(vec (sequence (interpose \",\") [\"a\" \"b\"]))"}
|
|
{:suite "clojure.core / leaf batch 3" :label "take-nth" :expected "[1 3 5]" :actual "(take-nth 2 [1 2 3 4 5 6])"}
|
|
{:suite "clojure.core / leaf batch 3" :label "take-nth lazy" :expected "[0 3 6]" :actual "(take 3 (take-nth 3 (range)))"}
|
|
{:suite "clojure.core / leaf batch 3" :label "take-nth xform" :expected "[1 3 5]" :actual "(vec (sequence (take-nth 2) [1 2 3 4 5 6]))"}
|
|
{:suite "clojure.core / leaf batch 3" :label "take-nth into" :expected "[1 4]" :actual "(into [] (take-nth 3) [1 2 3 4 5])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "sort-by keyfn" :expected "[[1 :b] [2 :a]]" :actual "(sort-by first [[2 :a] [1 :b]])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "sort-by string keys" :expected "[\"a\" \"bb\" \"ccc\"]" :actual "(sort-by count [\"ccc\" \"a\" \"bb\"])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "sort-by comparator" :expected "[3 2 1]" :actual "(sort-by identity > [1 3 2])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "sort-by 3way cmp" :expected "[3 2 1]" :actual "(sort-by identity (fn [a b] (- b a)) [1 3 2])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "sort-by mixed nil" :expected "[nil 1 2]" :actual "(sort-by identity [2 nil 1])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "sort-by empty" :expected "[]" :actual "(sort-by first [])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "sort-by nil coll" :expected "[]" :actual "(sort-by first nil)"}
|
|
{:suite "clojure.core / leaf batch 4" :label "rand-int range" :expected "true" :actual "(every? (fn [_] (let [r (rand-int 5)] (and (int? r) (<= 0 r 4)))) (range 50))"}
|
|
{:suite "clojure.core / leaf batch 4" :label "rand-int zero" :expected "0" :actual "(rand-int 1)"}
|
|
{:suite "clojure.core / leaf batch 4" :label "shuffle is permutation" :expected "true" :actual "(= (sort (shuffle [5 3 1 4 2])) [1 2 3 4 5])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "shuffle returns vector" :expected "true" :actual "(vector? (shuffle [1 2 3]))"}
|
|
{:suite "clojure.core / leaf batch 4" :label "shuffle empty" :expected "[]" :actual "(shuffle [])"}
|
|
{:suite "clojure.core / leaf batch 4" :label "shuffle non-coll throws" :expected :throws :actual "(shuffle 5)"}
|
|
{:suite "clojure.core / leaf batch 4" :label "random-uuid is uuid" :expected "true" :actual "(uuid? (random-uuid))"}
|
|
{:suite "clojure.core / leaf batch 4" :label "random-uuid v4 shape" :expected "true" :actual "(boolean (re-matches #\"[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\" (str (random-uuid))))"}
|
|
{:suite "clojure.core / leaf batch 4" :label "random-uuid distinct" :expected "true" :actual "(not= (random-uuid) (random-uuid))"}
|
|
{:suite "clojure.core / leaf batch 4" :label "char-escape newline" :expected "\"\\\\n\"" :actual "(char-escape-string \\newline)"}
|
|
{:suite "clojure.core / leaf batch 4" :label "char-escape quote" :expected "true" :actual "(= 2 (count (char-escape-string \\\")))"}
|
|
{:suite "clojure.core / leaf batch 4" :label "char-escape none" :expected "nil" :actual "(char-escape-string \\a)"}
|
|
{:suite "clojure.core / leaf batch 4" :label "char-name space" :expected "\"space\"" :actual "(char-name-string \\space)"}
|
|
{:suite "clojure.core / leaf batch 4" :label "char-name newline" :expected "\"newline\"" :actual "(char-name-string \\newline)"}
|
|
{:suite "clojure.core / leaf batch 4" :label "char-name none" :expected "nil" :actual "(char-name-string \\a)"}
|
|
{:suite "functions / recur into variadic arity" :label "counts rest via recur" :expected "3" :actual "((fn cnt [acc & xs] (if (seq xs) (recur (inc acc) (rest xs)) acc)) 0 :a :b :c)"}
|
|
{:suite "functions / recur into variadic arity" :label "zero-fixed variadic" :expected "4" :actual "((fn f [& xs] (if (< (count xs) 4) (recur (cons :x xs)) (count xs))) :a)"}
|
|
{:suite "functions / recur into variadic arity" :label "rest empties to nil" :expected "[:done]" :actual "((fn f [& xs] (if xs (recur (next xs)) (list :done))) 1 2)"}
|
|
{:suite "functions / recur into variadic arity" :label "multi-arity variadic recur" :expected "6" :actual "((fn ma ([a] a) ([a & xs] (if (seq xs) (recur (+ a (first xs)) (rest xs)) a))) 1 2 3)"}
|
|
{:suite "functions / recur into variadic arity" :label "recur passes nil rest" :expected ":empty" :actual "((fn f [acc & xs] (if (seq xs) (recur acc (rest xs)) :empty)) 0 1)"}
|
|
{:suite "functions / recur into variadic arity" :label "fixed-arity recur untouched" :expected "10" :actual "((fn f [n acc] (if (pos? n) (recur (dec n) (+ acc 2)) acc)) 5 0)"}
|
|
{:suite "functions / empty rest arg is nil" :label "no args" :expected ":nil" :actual "((fn [& r] (if r :truthy :nil)))"}
|
|
{:suite "functions / empty rest arg is nil" :label "after fixed" :expected ":nil" :actual "((fn [a & r] (if r :truthy :nil)) 1)"}
|
|
{:suite "functions / empty rest arg is nil" :label "via apply" :expected ":nil" :actual "(apply (fn [& r] (if r :truthy :nil)) [])"}
|
|
{:suite "functions / empty rest arg is nil" :label "defn no args" :expected ":nil" :actual "(do (defn er-f [& r] (if r :truthy :nil)) (er-f))"}
|
|
{:suite "functions / empty rest arg is nil" :label "non-empty unchanged" :expected "[1 2]" :actual "((fn [& r] r) 1 2)"}
|
|
{:suite "functions / empty rest arg is nil" :label "one extra" :expected "[2]" :actual "((fn [a & r] r) 1 2)"}
|
|
{:suite "functions / empty rest arg is nil" :label "rest destructure with no args" :expected ":nil" :actual "((fn [& [a]] (if a :truthy :nil)))"}
|
|
{:suite "functions / arity enforcement" :label "fixed extra args" :expected :throws :actual "((fn [x] x) 1 2)"}
|
|
{:suite "functions / arity enforcement" :label "fixed missing args" :expected :throws :actual "((fn [x y] x) 1)"}
|
|
{:suite "functions / arity enforcement" :label "fixed zero of one" :expected :throws :actual "((fn [x] x))"}
|
|
{:suite "functions / arity enforcement" :label "named defn extra" :expected :throws :actual "(do (defn af1 [x] x) (af1 1 2))"}
|
|
{:suite "functions / arity enforcement" :label "overlay fn extra" :expected :throws :actual "(identity 1 2)"}
|
|
{:suite "functions / arity enforcement" :label "through apply" :expected :throws :actual "(apply (fn [x] x) [1 2])"}
|
|
{:suite "functions / arity enforcement" :label "through update" :expected :throws :actual "(update {:k 1} :k identity 1 2 3 4)"}
|
|
{:suite "functions / arity enforcement" :label "variadic below min" :expected :throws :actual "((fn [x & r] x))"}
|
|
{:suite "functions / arity enforcement" :label "variadic at min" :expected "nil" :actual "((fn [x & r] r) 1)"}
|
|
{:suite "functions / arity enforcement" :label "variadic above min" :expected "[2 3]" :actual "((fn [x & r] r) 1 2 3)"}
|
|
{:suite "functions / arity enforcement" :label "multi-arity no match" :expected :throws :actual "((fn ([x] x) ([x y] y)) 1 2 3)"}
|
|
{:suite "functions / arity enforcement" :label "multi-arity variadic below min" :expected :throws :actual "((fn ([x] x) ([x y & r] r)))"}
|
|
{:suite "functions / arity enforcement" :label "destructured param counts as one" :expected "3" :actual "((fn [[a b] c] c) [1 2] 3)"}
|
|
{:suite "functions / arity enforcement" :label "destructured extra throws" :expected :throws :actual "((fn [[a b]] a) [1 2] [3 4])"}
|
|
{:suite "functions / arity enforcement" :label "hof exact arity ok" :expected "[2 4]" :actual "(mapv (fn [x] (* 2 x)) [1 2])"}
|
|
{:suite "functions / arity enforcement" :label "zero-arity fn ok" :expected "7" :actual "((fn [] 7))"}
|
|
{:suite "clojure.core / futures — deref" :label "future + deref" :expected "3" :actual "(deref (future (+ 1 2)))"}
|
|
{:suite "clojure.core / futures — deref" :label "@ reader macro derefs" :expected "42" :actual "@(future (* 6 7))"}
|
|
{:suite "clojure.core / futures — deref" :label "future returns collection" :expected "[2 3 4]" :actual "(deref (future (mapv inc [1 2 3])))"}
|
|
{:suite "clojure.core / futures — deref" :label "future returns a map" :expected "{:a 1}" :actual "(deref (future {:a 1}))"}
|
|
{:suite "clojure.core / futures — deref" :label "deref is cached/idempotent" :expected "[2 2]" :actual "(let [f (future (+ 1 1))] [(deref f) (deref f)])"}
|
|
{:suite "clojure.core / futures — deref" :label "timed deref of ready future" :expected "42" :actual "(let [f (future 42)] (deref f) (deref f 1000 :nope))"}
|
|
{:suite "clojure.core / futures — deref" :label "body error re-raised on deref" :expected :throws :actual "(deref (future (throw \"boom\")))"}
|
|
{:suite "clojure.core / futures — deref" :label "timed deref times out" :expected ":timed-out" :actual "(deref (future (do (Thread/sleep 300) :late)) 10 :timed-out)"}
|
|
{:suite "clojure.core / futures — deref" :label "Thread/sleep in body" :expected ":slept" :actual "(deref (future (do (Thread/sleep 5) :slept)))"}
|
|
{:suite "clojure.core / futures — deref" :label "timed-out future still completes" :expected ":late" :actual "(let [f (future (do (Thread/sleep 30) :late))] (deref f 5 :early) (deref f))"}
|
|
{:suite "clojure.core / futures — predicates" :label "future? true" :expected "true" :actual "(future? (future 1))"}
|
|
{:suite "clojure.core / futures — predicates" :label "future? false" :expected "false" :actual "(future? 42)"}
|
|
{:suite "clojure.core / futures — predicates" :label "future-done? after deref" :expected "true" :actual "(let [f (future 1)] (deref f) (future-done? f))"}
|
|
{:suite "clojure.core / futures — predicates" :label "realized? after deref" :expected "true" :actual "(let [f (future 1)] (deref f) (realized? f))"}
|
|
{:suite "clojure.core / futures — predicates" :label "cancel an in-flight future returns true" :expected "true" :actual "(let [f (future (do (Thread/sleep 100) 1))] (future-cancel f))"}
|
|
{:suite "clojure.core / futures — predicates" :label "future-cancelled? after cancel" :expected "true" :actual "(let [f (future (do (Thread/sleep 100) 1))] (future-cancel f) (future-cancelled? f))"}
|
|
{:suite "clojure.core / futures — predicates" :label "future-done? after cancel" :expected "true" :actual "(let [f (future 1)] (future-cancel f) (future-done? f))"}
|
|
{:suite "clojure.core / futures — predicates" :label "cancel an already-completed future returns false" :expected "false" :actual "(let [f (future 1)] (deref f) (future-cancel f))"}
|
|
{:suite "clojure.core / futures — predicates" :label "future-cancelled? fresh is false" :expected "false" :actual "(future-cancelled? (future 1))"}
|
|
{:suite "clojure.core / futures — snapshot (copy) semantics" :label "captured atom is snapshotted, not shared" :expected "1" :actual "(let [a (atom 0)] (deref (future (swap! a inc))) @a)"}
|
|
{:suite "clojure.core / futures — snapshot (copy) semantics" :label "future sees its own mutation" :expected "1" :actual "(let [a (atom 0)] (deref (future (swap! a inc))))"}
|
|
{:suite "clojure.core / pmap family" :label "pmap values in order" :expected "[2 3 4]" :actual "(vec (pmap inc [1 2 3]))"}
|
|
{:suite "clojure.core / pmap family" :label "pmap multi-coll" :expected "[5 7 9]" :actual "(vec (pmap + [1 2 3] [4 5 6]))"}
|
|
{:suite "clojure.core / pmap family" :label "pmap empty" :expected "[]" :actual "(pmap inc [])"}
|
|
{:suite "clojure.core / pmap family" :label "pmap is parallel" :expected "true" :actual "(do (deref (future :warmup)) (let [t0 (System/currentTimeMillis)] (dorun (pmap (fn [_] (Thread/sleep 200)) [1 2 3 4])) (< (- (System/currentTimeMillis) t0) 700)))"}
|
|
{:suite "clojure.core / pmap family" :label "pcalls" :expected "[1 2]" :actual "(vec (pcalls (fn [] 1) (fn [] 2)))"}
|
|
{:suite "clojure.core / pmap family" :label "pvalues" :expected "[3 7]" :actual "(vec (pvalues (+ 1 2) (+ 3 4)))"}
|
|
{:suite "clojure.core / pmap family" :label "snapshot semantics" :expected "2" :actual "(let [a (atom 0)] (dorun (pmap (fn [_] (swap! a inc)) [1 2])) (deref a))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "derive returns new h" :expected "true" :actual "(let [h (derive (make-hierarchy) :rect :shape)] (and (map? h) (isa? h :rect :shape)))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "original unchanged" :expected "false" :actual "(let [h0 (make-hierarchy) h1 (derive h0 :rect :shape)] (isa? h0 :rect :shape))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "isa? self" :expected "true" :actual "(isa? (make-hierarchy) :a :a)"}
|
|
{:suite "hierarchy / pure 3-arity" :label "isa? transitive" :expected "true" :actual "(let [h (-> (make-hierarchy) (derive :square :rect) (derive :rect :shape))] (isa? h :square :shape))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "multi-parent" :expected "[true true]" :actual "(let [h (-> (make-hierarchy) (derive :sq :rect) (derive :sq :rhombus))] [(isa? h :sq :rect) (isa? h :sq :rhombus)])"}
|
|
{:suite "hierarchy / pure 3-arity" :label "parents set" :expected "true" :actual "(let [h (-> (make-hierarchy) (derive :sq :rect) (derive :sq :rhombus))] (= #{:rect :rhombus} (parents h :sq)))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "ancestors transitive" :expected "true" :actual "(let [h (-> (make-hierarchy) (derive :square :rect) (derive :rect :shape))] (= #{:rect :shape} (ancestors h :square)))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "descendants transitive" :expected "true" :actual "(let [h (-> (make-hierarchy) (derive :square :rect) (derive :rect :shape))] (= #{:rect :square} (descendants h :shape)))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "underive removes" :expected "false" :actual "(let [h (-> (make-hierarchy) (derive :a :b) (underive :a :b))] (isa? h :a :b))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "vector isa?" :expected "true" :actual "(let [h (-> (make-hierarchy) (derive :rect :shape))] (isa? h [:rect :rect] [:shape :shape]))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "vector isa? length" :expected "false" :actual "(isa? (make-hierarchy) [:a] [:a :a])"}
|
|
{:suite "hierarchy / pure 3-arity" :label "cyclic derive throws" :expected :throws :actual "(-> (make-hierarchy) (derive :a :b) (derive :b :a))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "duplicate derive ok" :expected "true" :actual "(let [h (-> (make-hierarchy) (derive :a :b) (derive :a :b))] (isa? h :a :b))"}
|
|
{:suite "hierarchy / pure 3-arity" :label "parents nil when none" :expected "nil" :actual "(parents (make-hierarchy) :x)"}
|
|
{:suite "hierarchy / global + multimethod dispatch" :label "global derive + isa?" :expected "true" :actual "(do (derive :gsq :grect) (isa? :gsq :grect))"}
|
|
{:suite "hierarchy / global + multimethod dispatch" :label "global ancestors" :expected "true" :actual "(do (derive :ga :gb) (derive :gb :gc) (contains? (ancestors :ga) :gc))"}
|
|
{:suite "hierarchy / global + multimethod dispatch" :label "global underive" :expected "false" :actual "(do (derive :gu :gv) (underive :gu :gv) (isa? :gu :gv))"}
|
|
{:suite "hierarchy / global + multimethod dispatch" :label "dispatch via hierarchy" :expected ":is-shape" :actual "(do (derive :hsq :hshape) (defmulti hmm identity) (defmethod hmm :hshape [_] :is-shape) (hmm :hsq))"}
|
|
{:suite "hierarchy / global + multimethod dispatch" :label "dispatch custom hierarchy" :expected ":parent" :actual "(do (def hh (atom (derive (make-hierarchy) :c :p))) (defmulti cmm identity :hierarchy hh) (defmethod cmm :p [_] :parent) (cmm :c))"}
|
|
{:suite "hierarchy / global + multimethod dispatch" :label "dispatch exact beats isa" :expected ":exact" :actual "(do (derive :de1 :de2) (defmulti emm identity) (defmethod emm :de2 [_] :parent) (defmethod emm :de1 [_] :exact) (emm :de1))"}
|
|
{:suite "interop / dot forms" :label "method call" :expected "\"v=41\"" :actual "(. {:value 41 :describe (fn [self] (str \"v=\" (:value self)))} describe)"}
|
|
{:suite "interop / dot forms" :label "method with args" :expected "\"Hello Alice\"" :actual "(. {:greet (fn [self n] (str \"Hello \" n))} greet \"Alice\")"}
|
|
{:suite "interop / dot forms" :label "field access .-" :expected "41" :actual "(.-value {:value 41})"}
|
|
{:suite "interop / dot forms" :label "dot field keyword" :expected "41" :actual "(. {:value 41} :value)"}
|
|
{:suite "interop / dot dispatch arms" :label "zero-arg coll-interop .count" :expected "3" :actual "(.count [1 2 3])"}
|
|
{:suite "interop / dot dispatch arms" :label "zero-arg coll-interop .seq" :expected "[1 2]" :actual "(.seq [1 2])"}
|
|
{:suite "interop / dot dispatch arms" :label "explicit dot zero-arg interop" :expected "3" :actual "(. [1 2 3] count)"}
|
|
{:suite "interop / dot dispatch arms" :label "with-arg coll-interop .nth" :expected "2" :actual "(.nth [1 2 3] 1)"}
|
|
{:suite "interop / dot dispatch arms" :label "record zero-arg method" :expected "10" :actual "(do (defprotocol Pd (gm [this])) (defrecord Rd [x] Pd (gm [this] (* 2 x))) (.gm (->Rd 5)))"}
|
|
{:suite "interop / dot dispatch arms" :label "record method with args" :expected "15" :actual "(do (defprotocol Pa (am [this y])) (defrecord Ra [x] Pa (am [this y] (+ x y))) (.am (->Ra 5) 10))"}
|
|
{:suite "interop / dot dispatch arms" :label "deftype method with args" :expected "7" :actual "(do (defprotocol Pq (qq [this y])) (deftype Tq [x] Pq (qq [this y] (+ x y))) (.qq (Tq. 3) 4))"}
|
|
{:suite "interop / dot dispatch arms" :label "record -field is field access" :expected "7" :actual "(do (defrecord Rf [x]) (.-x (->Rf 7)))"}
|
|
{:suite "interop / dot dispatch arms" :label "object-method with args .equals" :expected "true" :actual "(.equals \"a\" \"a\")"}
|
|
{:suite "interop / arrays (aget/aset/alength)" :label "alength" :expected "3" :actual "(alength (object-array [1 2 3]))"}
|
|
{:suite "interop / arrays (aget/aset/alength)" :label "aget" :expected "20" :actual "(aget (object-array [10 20 30]) 1)"}
|
|
{:suite "interop / arrays (aget/aset/alength)" :label "aset returns val" :expected "9" :actual "(aset (object-array [1 2 3]) 1 9)"}
|
|
{:suite "interop / arrays (aget/aset/alength)" :label "aset mutates" :expected "[7 2 3]" :actual "(let [a (object-array [1 2 3])] (aset a 0 7) (vec a))"}
|
|
{:suite "interop / arrays (aget/aset/alength)" :label "aget 2d" :expected "4" :actual "(aget (to-array-2d [[1 2] [3 4]]) 1 1)"}
|
|
{:suite "interop / String methods" :label ".toLowerCase" :expected "\"hi\"" :actual "(.toLowerCase \"HI\")"}
|
|
{:suite "interop / String methods" :label ".toUpperCase" :expected "\"HI\"" :actual "(.toUpperCase \"hi\")"}
|
|
{:suite "interop / String methods" :label "dot-form" :expected "\"hi\"" :actual "(. \"HI\" toLowerCase)"}
|
|
{:suite "interop / String methods" :label ".trim" :expected "\"x\"" :actual "(.trim \" x \")"}
|
|
{:suite "interop / String methods" :label ".length" :expected "3" :actual "(.length \"abc\")"}
|
|
{:suite "interop / String methods" :label ".isEmpty" :expected "[true false]" :actual "[(.isEmpty \"\") (.isEmpty \"a\")]"}
|
|
{:suite "interop / String methods" :label ".indexOf hit" :expected "1" :actual "(.indexOf \"abc\" \"b\")"}
|
|
{:suite "interop / String methods" :label ".indexOf miss is -1" :expected "-1" :actual "(.indexOf \"abc\" \"z\")"}
|
|
{:suite "interop / String methods" :label ".lastIndexOf" :expected "3" :actual "(.lastIndexOf \"abab\" \"b\")"}
|
|
{:suite "interop / String methods" :label ".substring" :expected "\"bc\"" :actual "(.substring \"abc\" 1)"}
|
|
{:suite "interop / String methods" :label ".substring end" :expected "\"b\"" :actual "(.substring \"abc\" 1 2)"}
|
|
{:suite "interop / String methods" :label ".startsWith" :expected "true" :actual "(.startsWith \"abc\" \"ab\")"}
|
|
{:suite "interop / String methods" :label ".endsWith" :expected "true" :actual "(.endsWith \"abc\" \"bc\")"}
|
|
{:suite "interop / String methods" :label ".contains" :expected "true" :actual "(.contains \"abc\" \"b\")"}
|
|
{:suite "interop / String methods" :label ".replace" :expected "\"axc\"" :actual "(.replace \"abc\" \"b\" \"x\")"}
|
|
{:suite "interop / String methods" :label ".charAt" :expected "\\b" :actual "(.charAt \"abc\" 1)"}
|
|
{:suite "interop / String methods" :label ".equalsIgnoreCase" :expected "true" :actual "(.equalsIgnoreCase \"AbC\" \"aBc\")"}
|
|
{:suite "interop / String methods" :label "Long/MAX_VALUE" :expected "true" :actual "(pos? Long/MAX_VALUE)"}
|
|
{:suite "interop / String methods" :label "String/valueOf num" :expected "\"42\"" :actual "(String/valueOf 42)"}
|
|
{:suite "interop / String methods" :label "String/valueOf str" :expected "\"hi\"" :actual "(String/valueOf \"hi\")"}
|
|
{:suite "interop / String methods" :label "String/valueOf kw" :expected "\":k\"" :actual "(String/valueOf :k)"}
|
|
{:suite "interop / String methods" :label "String/valueOf nil" :expected "\"null\"" :actual "(String/valueOf nil)"}
|
|
{:suite "interop / String methods" :label "instance? CharSequence" :expected "true" :actual "(instance? CharSequence \"aaa\")"}
|
|
{:suite "interop / String methods" :label "instance? CharSequence non-str" :expected "false" :actual "(instance? CharSequence 42)"}
|
|
{:suite "interop / String methods" :label "unsupported method throws" :expected :throws :actual "(.frobnicate \"abc\")"}
|
|
{:suite "interop / java.time shims" :label "ofPattern formats #inst" :expected "true" :actual "(string? (.format (DateTimeFormatter/ofPattern \"yyyy-MM-dd\") #inst \"2020-03-05T13:45:30Z\"))"}
|
|
{:suite "interop / java.time shims" :label "pattern shape" :expected "true" :actual "(boolean (re-matches #\"\\d{4}-\\d{2}-\\d{2}\" (.format (DateTimeFormatter/ofPattern \"yyyy-MM-dd\") #inst \"2020-03-05T13:45:30Z\")))"}
|
|
{:suite "interop / java.time shims" :label "month name + ampm" :expected "true" :actual "(boolean (re-matches #\"[A-Z][a-z]{2} \\d{1,2}, 2020 \\d{1,2}:\\d{2} [AP]M\" (.format (DateTimeFormatter/ofPattern \"MMM d, yyyy h:mm a\") #inst \"2020-03-05T13:45:30Z\")))"}
|
|
{:suite "interop / java.time shims" :label "quoted literal" :expected "true" :actual "(boolean (re-matches #\"\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\" (.format DateTimeFormatter/ISO_LOCAL_DATE_TIME #inst \"2020-03-05T13:45:30Z\")))"}
|
|
{:suite "interop / java.time shims" :label "localized style" :expected "true" :actual "(string? (.format (DateTimeFormatter/ofLocalizedDate FormatStyle/MEDIUM) #inst \"2020-03-05T13:45:30Z\"))"}
|
|
{:suite "interop / java.time shims" :label "withLocale chain" :expected "true" :actual "(string? (.format (.withLocale (DateTimeFormatter/ofPattern \"yyyy\") (java.util.Locale. \"en\")) #inst \"2020-01-01T00:00:00Z\"))"}
|
|
{:suite "interop / java.time shims" :label "fix-date chain" :expected "true" :actual "(instance? LocalDateTime (-> #inst \"2020-03-05T13:45:30Z\" (.toInstant) (.atZone (ZoneId/systemDefault)) (.toLocalDateTime)))"}
|
|
{:suite "interop / java.time shims" :label "inst is java.util.Date" :expected "true" :actual "(instance? java.util.Date #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "interop / java.time shims" :label "Instant instance" :expected "true" :actual "(instance? java.time.Instant (Instant/ofEpochMilli 0))"}
|
|
{:suite "interop / java.time shims" :label "getTime epoch ms" :expected "0" :actual "(.getTime #inst \"1970-01-01T00:00:00Z\")"}
|
|
{:suite "interop / java.time shims" :label "toEpochMilli round trip" :expected "1234" :actual "(.toEpochMilli (Instant/ofEpochMilli 1234))"}
|
|
{:suite "interop / java.time shims" :label "Instant/now is current" :expected "true" :actual "(> (.toEpochMilli (Instant/now)) 1500000000000)"}
|
|
{:suite "interop / java.time shims" :label "sql types are not" :expected "false" :actual "(instance? java.sql.Timestamp #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "StringReader read" :expected "[97 98 -1]" :actual "(let [r (java.io.StringReader. \"ab\")] [(.read r) (.read r) (.read r)])"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "mark/reset" :expected "[97 97]" :actual "(let [r (StringReader. \"ab\")] (.mark r 1) [(.read r) (do (.reset r) (.read r))])"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "StringBuilder append" :expected "\"ab1\"" :actual "(.toString (-> (StringBuilder.) (.append \"a\") (.append \\b) (.append 1)))"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "capacity arg is not content" :expected "\"x\"" :actual "(.toString (.append (StringBuilder. 16) \"x\"))"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "setLength truncates" :expected "\"ab\"" :actual "(let [sb (StringBuilder.)] (.append sb \"abcd\") (.setLength sb 2) (.toString sb))"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "char-array of string" :expected "true" :actual "(instance? (Class/forName \"[C\") (char-array \"ab\"))"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "reader over char[]" :expected "97" :actual "(do (require (quote clojure.java.io)) (.read (clojure.java.io/reader (char-array \"abc\"))))"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "with-open closes shim" :expected "97" :actual "(with-open [r (StringReader. \"a\")] (.read r))"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "File.toURL methods read it back" :expected "\"file:/tmp/x\"" :actual "(do (require (quote clojure.java.io)) (.toString (.toURL (clojure.java.io/file \"/tmp/x\"))))"}
|
|
{:suite "interop / StringReader & StringBuilder" :label "vector :import shares deftype ctor" :expected "\"hi!\"" :actual "(do (ns spec.nodea) (defprotocol SpecP (spec-pm [this])) (deftype SpecTN [t] SpecP (spec-pm [this] (str t \"!\"))) (ns spec.nodeb (:import [spec.nodea SpecTN])) (.spec-pm (SpecTN. \"hi\")))"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "PushbackReader read" :expected "[97 98]" :actual "(let [r (java.io.PushbackReader. (java.io.StringReader. \"ab\"))] [(.read r) (.read r)])"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "unread pushes back" :expected "[97 97 98]" :actual "(let [r (PushbackReader. (StringReader. \"ab\")) a (.read r)] (.unread r a) [a (.read r) (.read r)])"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "unread accepts a char" :expected "[120 97]" :actual "(let [r (PushbackReader. (StringReader. \"a\"))] (.unread r \\x) [(.read r) (.read r)])"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "edn/read from reader" :expected "5432" :actual "(do (require (quote clojure.edn)) (clojure.edn/read (java.io.PushbackReader. (java.io.StringReader. \"{:db {:port 5432}}\\nrest\"))) (get-in (clojure.edn/read-string \"{:db {:port 5432}}\") [:db :port]))"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "edn/read multi-line" :expected "true" :actual "(do (require (quote clojure.edn)) (= {:a 1 :b 2} (clojure.edn/read (PushbackReader. (StringReader. \"{:a 1\\n :b 2}\")))))"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "Long/parseLong" :expected "42" :actual "(Long/parseLong \"42\")"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "parseLong rejects non-numeric" :expected :throws :actual "(Long/parseLong \"4x\")"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "BigInteger." :expected "123" :actual "(BigInteger. \"123\")"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "Boolean/parseBoolean" :expected "[true false false]" :actual "[(Boolean/parseBoolean \"true\") (Boolean/parseBoolean \"false\") (Boolean/parseBoolean \"yes\")]"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "System/getenv is a map" :expected "true" :actual "(string? (get (System/getenv) \"HOME\"))"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "System/exit resolves" :expected "true" :actual "(fn? System/exit)"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "getenv entries destructure (non-empty)" :expected "true" :actual "(let [es (map (fn [[k v]] [k v]) (System/getenv))] (and (pos? (count es)) (every? vector? es)))"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "seq over a raw host table" :expected "true" :actual "(pos? (count (seq (System/getenv))))"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "into {} from host table" :expected "true" :actual "(string? (get (into {} (map (fn [[k v]] [k v]) (System/getenv))) \"HOME\"))"}
|
|
{:suite "interop / PushbackReader & parse statics" :label "System/getProperties" :expected "true" :actual "(string? (get (System/getProperties) \"os.name\"))"}
|
|
{:suite "host-interop / ring-codec surface" :label "URLEncoder www form" :expected "\"a+b%3Dc\"" :actual "(URLEncoder/encode \"a b=c\")"}
|
|
{:suite "host-interop / ring-codec surface" :label "URLDecoder www form" :expected "\"a b=c\"" :actual "(URLDecoder/decode \"a+b%3Dc\" (Charset/forName \"UTF-8\"))"}
|
|
{:suite "host-interop / ring-codec surface" :label "url round trip" :expected "\"x &=%?\"" :actual "(URLDecoder/decode (URLEncoder/encode \"x &=%?\"))"}
|
|
{:suite "host-interop / ring-codec surface" :label "Base64 encode" :expected "\"aGVsbG8=\"" :actual "(String. (.encode (Base64/getEncoder) (.getBytes \"hello\")))"}
|
|
{:suite "host-interop / ring-codec surface" :label "Base64 round trip" :expected "\"hello\"" :actual "(String. (.decode (Base64/getDecoder) (String. (.encode (Base64/getEncoder) (.getBytes \"hello\")))))"}
|
|
{:suite "host-interop / ring-codec surface" :label "Integer radix + byteValue" :expected "-1" :actual "(.byteValue (Integer/valueOf \"ff\" 16))"}
|
|
{:suite "host-interop / ring-codec surface" :label "Integer parseInt" :expected "255" :actual "(Integer/parseInt \"ff\" 16)"}
|
|
{:suite "host-interop / ring-codec surface" :label "StringTokenizer" :expected "[\"a=1\" \"b=2\"]" :actual "(let [t (StringTokenizer. \"a=1&b=2\" \"&\")] [(.nextToken t) (.nextToken t)])"}
|
|
{:suite "host-interop / ring-codec surface" :label "MapEntry key/val" :expected "[:a 1]" :actual "(let [e (MapEntry. :a 1)] [(key e) (val e)])"}
|
|
{:suite "host-interop / ring-codec surface" :label "String ctor from bytes" :expected "\"hi\"" :actual "(String. (.getBytes \"hi\"))"}
|
|
{:suite "host-interop / ring-codec surface" :label "extend-protocol Map" :expected ":map" :actual "(do (defprotocol Pe (pe [x])) (extend-protocol Pe Map (pe [m] :map) Object (pe [o] :obj)) (pe {:a 1}))"}
|
|
{:suite "host-interop / ring-codec surface" :label "extend-protocol nil" :expected ":nil" :actual "(do (defprotocol Pn (pn [x])) (extend-protocol Pn nil (pn [n] :nil) Object (pn [o] :obj)) (pn nil))"}
|
|
{:suite "host-interop / ring-codec surface" :label "extend-protocol Map covers sorted" :expected ":map" :actual "(do (defprotocol Ps (ps [x])) (extend-protocol Ps Map (ps [m] :map) Object (ps [o] :obj)) (ps (sorted-map 1 2)))"}
|
|
{:suite "host-interop / ring-codec surface" :label "reduce over reified IReduceInit" :expected "42" :actual "(reduce + 0 (reify clojure.lang.IReduceInit (reduce [_ f init] (f (f init 40) 2))))"}
|
|
{:suite "core / reify" :label "multi-arity method dispatches by arg count" :expected "[:z 9]" :actual "(do (defprotocol P (m [_] [_ a])) (let [r (reify P (m [_] :z) (m [_ x] x))] [(m r) (m r 9)]))"}
|
|
{:suite "core / reify" :label "reify implements IObj and carries metadata" :expected "[true 2]" :actual "(do (defprotocol Q (qq [_])) (let [r (reify Q (qq [_] 1))] [(instance? clojure.lang.IObj r) (:k (meta (with-meta r {:k 2})))]))"}
|
|
{:suite "core / reify" :label "with-meta leaves the original untouched and keeps dispatch" :expected "[nil {:k 2} 1]" :actual "(do (defprotocol Q (qq [_])) (let [r (reify Q (qq [_] 1)) r2 (with-meta r {:k 2})] [(meta r) (meta r2) (qq r2)]))"}
|
|
{:suite "host-interop / class tokens & readers" :label "class name evaluates to canonical string" :expected "java.lang.String" :actual "String"}
|
|
{:suite "host-interop / class tokens & readers" :label "dispatch-only class name" :expected "\"java.io.InputStream\"" :actual "InputStream"}
|
|
{:suite "host-interop / class tokens & readers" :label "(class x) matches the token" :expected "true" :actual "(= String (class \"abc\"))"}
|
|
{:suite "host-interop / class tokens & readers" :label "defmulti on class dispatches" :expected ":str" :actual "(do (defmulti cm (fn [x] (class x))) (defmethod cm String [x] :str) (cm \"a\"))"}
|
|
{:suite "host-interop / class tokens & readers" :label "defmethod on nil dispatch value" :expected ":nil" :actual "(do (defmulti cn (fn [x] (class x))) (defmethod cn nil [x] :nil) (defmethod cn String [x] :str) (cn nil))"}
|
|
{:suite "host-interop / class tokens & readers" :label "Class str is class-prefixed" :expected "\"class java.lang.String\"" :actual "(str (class \"\"))"}
|
|
{:suite "host-interop / class tokens & readers" :label "Class getName" :expected "\"java.lang.String\"" :actual "(.getName (class \"\"))"}
|
|
{:suite "host-interop / class tokens & readers" :label "Class getSimpleName" :expected "\"Long\"" :actual "(.getSimpleName (class 5))"}
|
|
{:suite "host-interop / class tokens & readers" :label "Class of equal-typed values is =" :expected "true" :actual "(= (class 5) (class 6))"}
|
|
{:suite "host-interop / class tokens & readers" :label "Class in a thrown message" :expected "\"of class java.lang.String\"" :actual "(try (throw (Exception. (str \"of \" (class \"\")))) (catch Exception e (.getMessage e)))"}
|
|
{:suite "host-interop / class tokens & readers" :label "ctor sugar still constructs" :expected "\"x\"" :actual "(.toString (StringBuilder. \"x\"))"}
|
|
{:suite "host-interop / class tokens & readers" :label "return-hinted defn parses" :expected "7" :actual "(do (defn- hb ^bytes [b] b) (hb 7))"}
|
|
{:suite "host-interop / class tokens & readers" :label "hinted multi-arity parses" :expected ":two" :actual "((fn ([x] :one) (^String [x y] :two)) 1 2)"}
|
|
{:suite "host-interop / class tokens & readers" :label "slurp drains a StringReader" :expected "\"a=1\"" :actual "(slurp (StringReader. \"a=1\"))"}
|
|
{:suite "host-interop / class tokens & readers" :label "slurp accepts :encoding opts" :expected "\"b\"" :actual "(slurp (StringReader. \"b\") :encoding \"UTF-8\")"}
|
|
{:suite "host-interop / class tokens & readers" :label "replace with fn replacement is literal" :expected "\"$0\"" :actual "(do (require (quote [clojure.string :as s9])) (s9/replace \"x\" #\".\" (fn [m] \"$0\")))"}
|
|
{:suite "host-interop / class tokens & readers" :label "replace fn gets group vector" :expected "\"v=k\"" :actual "(do (require (quote [clojure.string :as s9])) (s9/replace \"k=v\" #\"(\\w+)=(\\w+)\" (fn [[_ k v]] (str v \"=\" k))))"}
|
|
{:suite "host-interop / class tokens & readers" :label "indexOf int needle is a char code" :expected "1" :actual "(.indexOf \"a=b\" 61)"}
|
|
{:suite "host-interop / exception + HashMap shims" :label "getMessage on a thrown string" :expected "\"class java.lang.String cannot be cast to class java.lang.Throwable (java.lang.String and java.lang.Throwable are in module java.base of loader 'bootstrap')\"" :actual "(try (throw \"boom\") (catch Throwable e (.getMessage e)))"}
|
|
{:suite "host-interop / exception + HashMap shims" :label "getMessage on ex-info" :expected "\"bad\"" :actual "(try (throw (ex-info \"bad\" {})) (catch Throwable e (.getMessage e)))"}
|
|
{:suite "host-interop / exception + HashMap shims" :label "HashMap get" :expected "2" :actual "(let [m (HashMap. {:a 1 :b 2})] (.get m :b))"}
|
|
{:suite "host-interop / exception + HashMap shims" :label "HashMap put + size" :expected "2" :actual "(let [m (HashMap. {})] (.put m :x 1) (.put m :y 2) (.size m))"}
|
|
{:suite "host-interop / reader-feature toggle" :label "features default to jolt+default" :expected "true" :actual "(contains? (set (__reader-features)) \"jolt\")"}
|
|
{:suite "host-interop / reader-feature toggle" :label "set + read back" :expected "true" :actual "(do (def prev (__reader-features)) (__reader-features-set! [\"clj\" \"jolt\" \"default\"]) (def r (contains? (set (__reader-features)) \"clj\")) (__reader-features-set! prev) r)"}
|
|
{:suite "host-interop / reader-feature toggle" :label "restore returns to default" :expected "false" :actual "(do (def prev (__reader-features)) (__reader-features-set! [\"clj\"]) (__reader-features-set! prev) (contains? (set (__reader-features)) \"clj\"))"}
|
|
{:suite "host-interop / migratus class shims" :label "Exception. message" :expected "\"boom\"" :actual "(try (throw (Exception. \"boom\")) (catch Throwable e (.getMessage e)))"}
|
|
{:suite "host-interop / migratus class shims" :label "IllegalArgumentException." :expected "\"bad\"" :actual "(try (throw (IllegalArgumentException. \"bad\")) (catch Exception e (.getMessage e)))"}
|
|
{:suite "host-interop / migratus class shims" :label "InterruptedException." :expected "\"stop\"" :actual "(try (throw (InterruptedException. \"stop\")) (catch Throwable e (.getMessage e)))"}
|
|
{:suite "host-interop / migratus class shims" :label "Character/isUpperCase" :expected "true" :actual "(Character/isUpperCase \\A)"}
|
|
{:suite "host-interop / migratus class shims" :label "Character/isLowerCase" :expected "true" :actual "(Character/isLowerCase \\a)"}
|
|
{:suite "host-interop / migratus class shims" :label "Character/isUpperCase neg" :expected "false" :actual "(Character/isUpperCase \\a)"}
|
|
{:suite "host-interop / migratus class shims" :label "Thread/interrupted" :expected "false" :actual "(Thread/interrupted)"}
|
|
{:suite "host-interop / migratus class shims" :label "Long/valueOf" :expected "42" :actual "(Long/valueOf \"42\")"}
|
|
{:suite "host-interop / migratus class shims" :label "Timestamp is millis" :expected "1000" :actual "(.getTime (java.util.Date. (java.sql.Timestamp. 1000)))"}
|
|
{:suite "host-interop / migratus class shims" :label "SimpleDateFormat UTC" :expected "\"19700101000000\"" :actual "(let [f (doto (java.text.SimpleDateFormat. \"yyyyMMddHHmmss\") (.setTimeZone (java.util.TimeZone/getTimeZone \"UTC\")))] (.format f (java.util.Date. 0)))"}
|
|
{:suite "host-interop / java.io.File" :label "instance? File" :expected "true" :actual "(do (require '[clojure.java.io :as io]) (instance? java.io.File (io/file \"/a/b\")))"}
|
|
{:suite "host-interop / java.io.File" :label "str is the path" :expected "\"/a/b\"" :actual "(do (require '[clojure.java.io :as io]) (str (io/file \"/a/b\")))"}
|
|
{:suite "host-interop / java.io.File" :label "getName" :expected "\"c.txt\"" :actual "(do (require '[clojure.java.io :as io]) (.getName (io/file \"/a/b/c.txt\")))"}
|
|
{:suite "host-interop / java.io.File" :label "getPath joins" :expected "\"/a/b\"" :actual "(do (require '[clojure.java.io :as io]) (.getPath (io/file \"/a\" \"b\")))"}
|
|
{:suite "host-interop / java.io.File" :label "isDirectory of repo dir" :expected "true" :actual "(do (require '[clojure.java.io :as io]) (.isDirectory (io/file \"docs\")))"}
|
|
{:suite "host-interop / java.io.File" :label "isFile of repo file" :expected "true" :actual "(do (require '[clojure.java.io :as io]) (.isFile (io/file \"README.md\")))"}
|
|
{:suite "host-interop / java.io.File" :label "exists is false off-disk" :expected "false" :actual "(do (require '[clojure.java.io :as io]) (.exists (io/file \"/no/such/path/xyz\")))"}
|
|
{:suite "host-interop / java.io.File" :label "file-seq yields File values" :expected "true" :actual "(do (require '[clojure.java.io :as io]) (every? (fn [f] (instance? java.io.File f)) (file-seq (io/file \"docs\"))))"}
|
|
{:suite "host-interop / java.io.File" :label "file-seq finds files" :expected "true" :actual "(do (require '[clojure.java.io :as io]) (pos? (count (filter (fn [f] (.isFile f)) (file-seq (io/file \"docs\"))))))"}
|
|
{:suite "host-interop / logging host shims" :label "LockingTransaction/isRunning" :expected "false" :actual "(clojure.lang.LockingTransaction/isRunning)"}
|
|
{:suite "host-interop / logging host shims" :label "pprint writes value" :expected "\"[1 2 3]\\n\"" :actual "(do (require '[clojure.pprint :as pp]) (with-out-str (pp/pprint [1 2 3])))"}
|
|
{:suite "host-interop / logging host shims" :label "with-pprint-dispatch runs body" :expected "42" :actual "(do (require '[clojure.pprint :as pp]) (pp/with-pprint-dispatch pp/code-dispatch 42))"}
|
|
{:suite "host-interop / macro dispatch & short-circuit patterns" :label "conditional-eval suppresses" :expected "0" :actual "(do (def ^:dynamic *enabled* false) (defmacro when-on [& body] `(when *enabled* ~@body)) (let [a (atom 0)] (when-on (reset! a 9)) @a))"}
|
|
{:suite "host-interop / macro dispatch & short-circuit patterns" :label "conditional-eval fires" :expected "9" :actual "(do (def ^:dynamic *enabled* true) (defmacro when-on [& body] `(when *enabled* ~@body)) (let [a (atom 0)] (when-on (reset! a 9)) @a))"}
|
|
{:suite "host-interop / macro dispatch & short-circuit patterns" :label "spy-like eval+print+return" :expected "3" :actual "(do (defmacro spylog [expr] `(let [v# ~expr] (println v#) v#)) (spylog (+ 1 2)))"}
|
|
{:suite "host-interop / macro dispatch & short-circuit patterns" :label "multi-arity 4 dispatch" :expected "[:single :double :triple :quad]" :actual "(do (defmacro ml ([a] :single) ([a b] :double) ([a b c] :triple) ([a b c d] :quad)) [(ml 1) (ml 1 2) (ml 1 2 3) (ml 1 2 3 4)])"}
|
|
{:suite "inst / reading & identity" :label "reads to inst" :expected "true" :actual "(inst? #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "inst / reading & identity" :label "inst? false on string" :expected "false" :actual "(inst? \"2020-01-01\")"}
|
|
{:suite "inst / reading & identity" :label "epoch zero" :expected "0" :actual "(inst-ms #inst \"1970-01-01T00:00:00Z\")"}
|
|
{:suite "inst / reading & identity" :label "one second" :expected "1000" :actual "(inst-ms #inst \"1970-01-01T00:00:01Z\")"}
|
|
{:suite "inst / reading & identity" :label "millis" :expected "123" :actual "(inst-ms #inst \"1970-01-01T00:00:00.123Z\")"}
|
|
{:suite "inst / reading & identity" :label "a real date" :expected "1577836800000" :actual "(inst-ms #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "inst / reading & identity" :label "inst-ms throws on non-inst" :expected :throws :actual "(inst-ms 42)"}
|
|
{:suite "inst / partial timestamps & offsets" :label "year only" :expected "true" :actual "(= #inst \"2020\" #inst \"2020-01-01T00:00:00.000Z\")"}
|
|
{:suite "inst / partial timestamps & offsets" :label "year-month" :expected "true" :actual "(= #inst \"2020-03\" #inst \"2020-03-01T00:00:00Z\")"}
|
|
{:suite "inst / partial timestamps & offsets" :label "date only" :expected "true" :actual "(= #inst \"2020-03-15\" #inst \"2020-03-15T00:00:00Z\")"}
|
|
{:suite "inst / partial timestamps & offsets" :label "positive offset" :expected "true" :actual "(= #inst \"2020-01-01T01:00:00+01:00\" #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "inst / partial timestamps & offsets" :label "negative offset" :expected "true" :actual "(= #inst \"2019-12-31T23:00:00-01:00\" #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "inst / partial timestamps & offsets" :label "-00:00 offset" :expected "true" :actual "(= #inst \"2020-01-01T00:00:00-00:00\" #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "inst / partial timestamps & offsets" :label "bad timestamp throws" :expected :throws :actual "#inst \"garbage\""}
|
|
{:suite "inst / value semantics & printing" :label "equal by instant" :expected "true" :actual "(= #inst \"2020-01-01T00:00:00Z\" #inst \"2020-01-01T00:00:00.000Z\")"}
|
|
{:suite "inst / value semantics & printing" :label "unequal instants" :expected "false" :actual "(= #inst \"2020-01-01T00:00:00Z\" #inst \"2020-01-01T00:00:01Z\")"}
|
|
{:suite "inst / value semantics & printing" :label "works as map key" :expected ":v" :actual "(get {#inst \"2020-01-01T00:00:00Z\" :v} #inst \"2020-01-01T00:00:00.000Z\")"}
|
|
{:suite "inst / value semantics & printing" :label "pr-str round-trips" :expected "\"#inst \\\"2020-01-01T00:00:00.000-00:00\\\"\"" :actual "(pr-str #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "io / with-out-str captures" :label "println" :expected "\"hi\\n\"" :actual "(with-out-str (println \"hi\"))"}
|
|
{:suite "io / with-out-str captures" :label "print spaces" :expected "\"a b\"" :actual "(with-out-str (print \"a\" \"b\"))"}
|
|
{:suite "io / with-out-str captures" :label "prn quotes" :expected "\"[1 2]\\n\"" :actual "(with-out-str (prn [1 2]))"}
|
|
{:suite "io / with-out-str captures" :label "pr no newline" :expected "\"5\"" :actual "(with-out-str (pr 5))"}
|
|
{:suite "io / with-out-str captures" :label "multiple writes" :expected "\"12\"" :actual "(with-out-str (print 1) (print 2))"}
|
|
{:suite "io / with-out-str captures" :label "no output" :expected "\"\"" :actual "(with-out-str 42)"}
|
|
{:suite "io / with-out-str captures" :label "println no args" :expected "\"\\n\"" :actual "(with-out-str (println))"}
|
|
{:suite "io / *-str builders" :label "print-str" :expected "\"a b\"" :actual "(print-str \"a\" \"b\")"}
|
|
{:suite "io / *-str builders" :label "println-str" :expected "\"x\\n\"" :actual "(println-str \"x\")"}
|
|
{:suite "io / *-str builders" :label "prn-str" :expected "\"[1 2]\\n\"" :actual "(prn-str [1 2])"}
|
|
{:suite "io / *-str builders" :label "pr-str quotes" :expected "\"\\\"s\\\"\"" :actual "(pr-str \"s\")"}
|
|
{:suite "io / *-str builders" :label "pr-str keyword" :expected "\":a\"" :actual "(pr-str :a)"}
|
|
{:suite "io / str & format" :label "str concat" :expected "\"1:ab\"" :actual "(str 1 :a \"b\")"}
|
|
{:suite "io / str & format" :label "str nil" :expected "\"\"" :actual "(str nil)"}
|
|
{:suite "io / str & format" :label "str of coll" :expected "\"[1 2]\"" :actual "(str [1 2])"}
|
|
{:suite "io / str & format" :label "format d/s" :expected "\"5-x\"" :actual "(format \"%d-%s\" 5 \"x\")"}
|
|
{:suite "io / str & format" :label "format float" :expected "\"3.14\"" :actual "(format \"%.2f\" 3.14159)"}
|
|
{:suite "io / *in* + with-in-str + read-line" :label "read-line one line" :expected "\"hello\"" :actual "(with-in-str \"hello\" (read-line))"}
|
|
{:suite "io / *in* + with-in-str + read-line" :label "read-line strips nl" :expected "\"a\"" :actual "(with-in-str \"a\\nb\" (read-line))"}
|
|
{:suite "io / *in* + with-in-str + read-line" :label "read-line sequential" :expected "[\"a\" \"b\"]" :actual "(with-in-str \"a\\nb\" [(read-line) (read-line)])"}
|
|
{:suite "io / *in* + with-in-str + read-line" :label "read-line EOF nil" :expected "nil" :actual "(with-in-str \"\" (read-line))"}
|
|
{:suite "io / *in* + with-in-str + read-line" :label "read-line after last" :expected "[\"x\" nil]" :actual "(with-in-str \"x\" [(read-line) (read-line)])"}
|
|
{:suite "io / *in* + with-in-str + read-line" :label "empty line" :expected "[\"\" \"y\"]" :actual "(with-in-str \"\\ny\" [(read-line) (read-line)])"}
|
|
{:suite "io / *in* + with-in-str + read-line" :label "*in* is bound" :expected "false" :actual "(with-in-str \"\" (map? *in*))"}
|
|
{:suite "io / read" :label "read a form" :expected "42" :actual "(with-in-str \"42\" (read))"}
|
|
{:suite "io / read" :label "read a list form" :expected "(quote (+ 1 2))" :actual "(with-in-str \"(+ 1 2)\" (read))"}
|
|
{:suite "io / read" :label "read two forms" :expected "[1 2]" :actual "(with-in-str \"1 2\" [(read) (read)])"}
|
|
{:suite "io / read" :label "read then read-line" :expected "[1 \" rest\"]" :actual "(with-in-str \"1 rest\\nnext\" [(read) (read-line)])"}
|
|
{:suite "io / read" :label "read vector" :expected "[1 2]" :actual "(with-in-str \"[1 2]\" (read))"}
|
|
{:suite "io / read" :label "read nil literal" :expected "nil" :actual "(with-in-str \"nil\" (read))"}
|
|
{:suite "io / read" :label "read EOF throws" :expected :throws :actual "(with-in-str \"\" (read))"}
|
|
{:suite "io / read" :label "read EOF value" :expected ":done" :actual "(with-in-str \"\" (read *in* false :done))"}
|
|
{:suite "io / read" :label "read eval data" :expected "3" :actual "(with-in-str \"(+ 1 2)\" (eval (read)))"}
|
|
{:suite "io / line-seq" :label "line-seq" :expected "[\"a\" \"b\" \"c\"]" :actual "(with-in-str \"a\\nb\\nc\" (vec (line-seq *in*)))"}
|
|
{:suite "io / line-seq" :label "line-seq empty" :expected "nil" :actual "(with-in-str \"\" (seq (line-seq *in*)))"}
|
|
{:suite "io / line-seq" :label "line-seq is lazy seq" :expected "true" :actual "(with-in-str \"a\\nb\" (seq? (line-seq *in*)))"}
|
|
{:suite "io / line-seq" :label "line-seq count" :expected "3" :actual "(with-in-str \"1\\n2\\n3\" (count (line-seq *in*)))"}
|
|
{:suite "io / print family (overlay)" :label "pr-str multi-arg spacing" :expected "\"\\\"a\\\" [1 2] :k\"" :actual "(pr-str \"a\" [1 2] :k)"}
|
|
{:suite "io / print family (overlay)" :label "pr-str zero args" :expected "\"\"" :actual "(pr-str)"}
|
|
{:suite "io / print family (overlay)" :label "pr-str escapes" :expected "\"\\\"a\\\\\\\"b\\\"\"" :actual "(pr-str \"a\\\"b\")"}
|
|
{:suite "io / print family (overlay)" :label "print is unreadable" :expected "\"a b\"" :actual "(with-out-str (print \"a\" \"b\"))"}
|
|
{:suite "io / print family (overlay)" :label "println appends newline" :expected "\"x 1\\n\"" :actual "(with-out-str (println \"x\" 1))"}
|
|
{:suite "io / print family (overlay)" :label "prn is readable + newline" :expected "\"[1 \\\"s\\\"]\\n\"" :actual "(with-out-str (prn [1 \"s\"]))"}
|
|
{:suite "io / print family (overlay)" :label "pr writes no newline" :expected "\"\\\\a\"" :actual "(with-out-str (pr \\a))"}
|
|
{:suite "io / print family (overlay)" :label "print nil arg" :expected "\"nil\"" :actual "(with-out-str (print nil))"}
|
|
{:suite "io / print family (overlay)" :label "prn keyword" :expected "\":k\\n\"" :actual "(with-out-str (prn :k))"}
|
|
{:suite "io / print-method multimethod" :label "records print canonically" :expected "\"#user.Pt{:x 1, :y 2}\"" :actual "(do (defrecord Pt [x y]) (pr-str (->Pt 1 2)))"}
|
|
{:suite "io / print-method multimethod" :label "records nested in colls" :expected "\"[#user.Pt{:x 1, :y 2}]\"" :actual "(do (defrecord Pt [x y]) (pr-str [(->Pt 1 2)]))"}
|
|
{:suite "io / print-method multimethod" :label "defmethod overrides a record, top level" :expected "\"#user.Pt{:x 3, :y 4}\"" :actual "(do (defrecord Pt [x y]) (defmethod print-method (quote user.Pt) [r w] (.write w (str \"<\" (:x r) \",\" (:y r) \">\"))) (pr-str (->Pt 3 4)))"}
|
|
{:suite "io / print-method multimethod" :label "defmethod fires nested in a map" :expected "\"{:p #user.Pt{:x 5, :y 6}}\"" :actual "(do (defrecord Pt [x y]) (defmethod print-method (quote user.Pt) [r w] (.write w (str \"<\" (:x r) \",\" (:y r) \">\"))) (pr-str {:p (->Pt 5 6)}))"}
|
|
{:suite "io / print-method multimethod" :label "defmethod fires through prn" :expected "\"[#user.Pt{:x 1, :y 2}]\\n\"" :actual "(do (defrecord Pt [x y]) (defmethod print-method (quote user.Pt) [r w] (.write w (str \"<\" (:x r) \",\" (:y r) \">\"))) (with-out-str (prn [(->Pt 1 2)])))"}
|
|
{:suite "io / print-method multimethod" :label "direct call uses :default" :expected "\"42\"" :actual "(let [w (StringWriter.)] (print-method 42 w) (.toString w))"}
|
|
{:suite "io / print-method multimethod" :label "direct builtin override" :expected "\"#42#\"" :actual "(do (defmethod print-method :number [n w] (.write w (str \"#\" n \"#\"))) (let [w (StringWriter.)] (print-method 42 w) (.toString w)))"}
|
|
{:suite "io / print-method multimethod" :label "print-dup routes to print-method" :expected "\"[1 2]\"" :actual "(let [w (StringWriter.)] (print-dup [1 2] w) (.toString w))"}
|
|
{:suite "io / print-method multimethod" :label "StringWriter accumulates" :expected "\"ab\"" :actual "(let [w (StringWriter.)] (.write w \"a\") (.append w \\b) (.toString w))"}
|
|
{:suite "io / print-method multimethod" :label "methods table inspectable" :expected "true" :actual "(do (defrecord Pt [x y]) (defmethod print-method (quote user.Pt) [r w] r) (contains? (methods print-method) (quote user.Pt)))"}
|
|
{:suite "io / cold tagged types via print-method" :label "uuid" :expected "\"#uuid \\\"b6883c0a-0342-4007-9966-bc2dfa6b109e\\\"\"" :actual "(pr-str (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\"))"}
|
|
{:suite "io / cold tagged types via print-method" :label "uuid nested" :expected "\"[#uuid \\\"b6883c0a-0342-4007-9966-bc2dfa6b109e\\\"]\"" :actual "(pr-str [(parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\")])"}
|
|
{:suite "io / cold tagged types via print-method" :label "regex" :expected "\"#\\\"a+b\\\"\"" :actual "(pr-str #\"a+b\")"}
|
|
{:suite "io / cold tagged types via print-method" :label "transient vector" :expected "\"#object[clojure.lang.PersistentVector$TransientVector 0xa4ac20b \\\"clojure.lang.PersistentVector$TransientVector@a4ac20b\\\"]\"" :actual "(pr-str (transient [1]))"}
|
|
{:suite "io / cold tagged types via print-method" :label "transient map" :expected "\"#object[clojure.lang.PersistentArrayMap$TransientArrayMap 0x79939c8 \\\"clojure.lang.PersistentArrayMap$TransientArrayMap@79939c8\\\"]\"" :actual "(pr-str (transient {:a 1}))"}
|
|
{:suite "io / cold tagged types via print-method" :label "atom override fires nested" :expected "\"{:a #object[clojure.lang.Atom 0x2bb39d6c {:status :ready, :val 7}]}\"" :actual "(do (defmethod print-method :jolt/atom [a w] (.write w (str \"#atom[\" (deref a) \"]\"))) (pr-str {:a (atom 7)}))"}
|
|
{:suite "io / cold tagged types via print-method" :label "uuid through str unchanged" :expected "\"b6883c0a-0342-4007-9966-bc2dfa6b109e\"" :actual "(str (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\"))"}
|
|
{:suite "ISeq call forms" :label "eval a cons'd call" :expected "3" :actual "(eval (cons (quote +) (quote (1 2))))"}
|
|
{:suite "ISeq call forms" :label "eval a list-built call" :expected "6" :actual "(eval (list (quote +) 1 2 3))"}
|
|
{:suite "ISeq call forms" :label "eval a concat'd call" :expected "10" :actual "(eval (concat (list (quote +)) (list 1 2 3 4)))"}
|
|
{:suite "ISeq call forms" :label "nested cons'd subform" :expected "7" :actual "(eval (list (quote +) 3 (cons (quote +) (quote (1 3)))))"}
|
|
{:suite "ISeq call forms" :label "empty list self-evals" :expected "[]" :actual "(eval (list))"}
|
|
{:suite "ISeq call forms" :label "macro output via cons" :expected "3" :actual "(do (defmacro mc [] (cons (quote +) (quote (1 2)))) (mc))"}
|
|
{:suite "ISeq call forms" :label "macro output via concat" :expected "6" :actual "(do (defmacro mk [] (concat (list (quote +)) (list 1 2 3))) (mk))"}
|
|
{:suite "ISeq call forms" :label "vector value self-evals" :expected "[1 2 3]" :actual "(eval (vec [1 2 3]))"}
|
|
{:suite "ISeq call forms" :label "quoted list of data" :expected "[1 2 3]" :actual "(quote (1 2 3))"}
|
|
{:suite "lazy / construction & laziness" :label "lazy-seq value" :expected "[1 2 3]" :actual "(take 3 (lazy-seq (cons 1 (lazy-seq (cons 2 (lazy-seq (cons 3 nil)))))))"}
|
|
{:suite "lazy / construction & laziness" :label "not eagerly evaluated" :expected "0" :actual "(let [c (atom 0)] (lazy-seq (swap! c inc) nil) @c)"}
|
|
{:suite "lazy / construction & laziness" :label "realized on demand" :expected "1" :actual "(let [c (atom 0) s (lazy-seq (swap! c inc) [1])] (first s) @c)"}
|
|
{:suite "lazy / construction & laziness" :label "lazy-cat" :expected "[0 1 2 3]" :actual "(lazy-cat [0 1] [2 3])"}
|
|
{:suite "lazy / construction & laziness" :label "doall forces" :expected "[2 3 4]" :actual "(doall (map inc [1 2 3]))"}
|
|
{:suite "lazy / construction & laziness" :label "dorun returns nil" :expected "nil" :actual "(dorun (map inc [1 2 3]))"}
|
|
{:suite "lazy / infinite" :label "take from repeat" :expected "[7 7 7]" :actual "(take 3 (repeat 7))"}
|
|
{:suite "lazy / infinite" :label "take from iterate" :expected "[1 2 4 8]" :actual "(take 4 (iterate (fn [x] (* 2 x)) 1))"}
|
|
{:suite "lazy / infinite" :label "take from cycle" :expected "[1 2 1 2]" :actual "(take 4 (cycle [1 2]))"}
|
|
{:suite "lazy / infinite" :label "take from range" :expected "[0 1 2]" :actual "(take 3 (range))"}
|
|
{:suite "lazy / infinite" :label "drop then take" :expected "[5 6 7]" :actual "(take 3 (drop 5 (range)))"}
|
|
{:suite "lazy / infinite" :label "filter infinite" :expected "[0 2 4]" :actual "(take 3 (filter even? (range)))"}
|
|
{:suite "lazy / infinite" :label "map infinite" :expected "[0 1 4]" :actual "(take 3 (map (fn [x] (* x x)) (range)))"}
|
|
{:suite "lazy / infinite" :label "nth of infinite" :expected "100" :actual "(nth (range) 100)"}
|
|
{:suite "lazy / self-referential" :label "self-ref ones" :expected "[1 1 1 1 1]" :actual "(do (def ones (lazy-seq (cons 1 ones))) (take 5 ones))"}
|
|
{:suite "lazy / self-referential" :label "self-ref nats" :expected "[0 1 2 3 4]" :actual "(do (def nats (lazy-cat [0] (map inc nats))) (take 5 nats))"}
|
|
{:suite "lazy / self-referential" :label "self-ref fib" :expected "[0 1 1 2 3 5 8 13 21 34]" :actual "(do (def fib (lazy-cat [0 1] (map + (rest fib) fib))) (take 10 fib))"}
|
|
{:suite "lazy / realized?" :label "unrealized" :expected "false" :actual "(realized? (lazy-seq (cons 1 nil)))"}
|
|
{:suite "lazy / realized?" :label "realized after" :expected "true" :actual "(let [s (lazy-seq (cons 1 nil))] (first s) (realized? s))"}
|
|
{:suite "lazy / realized?" :label "body runs once" :expected "1" :actual "(let [c (atom 0) s (lazy-seq (do (swap! c inc) [1 2 3]))] (seq s) (seq s) @c)"}
|
|
{:suite "lazy-seq / realization is shared across walks" :label "effects run once across three walks" :expected "3" :actual "(let [a (atom 0) s (map (fn [x] (swap! a inc) x) [1 2 3])] (doall s) (dorun s) (vec s) (deref a))"}
|
|
{:suite "lazy-seq / realization is shared across walks" :label "values stable across walks" :expected "true" :actual "(let [s (map inc [1 2 3])] (= (vec s) (vec s) [2 3 4]))"}
|
|
{:suite "lazy-seq / realization is shared across walks" :label "filter effects once" :expected "4" :actual "(let [a (atom 0) s (filter (fn [x] (swap! a inc) (odd? x)) [1 2 3 4])] (dorun s) (count s) (deref a))"}
|
|
{:suite "list / construct & predicate" :label "list" :expected "[1 2 3]" :actual "(list 1 2 3)"}
|
|
{:suite "list / construct & predicate" :label "empty list" :expected "[]" :actual "(list)"}
|
|
{:suite "list / construct & predicate" :label "quoted list" :expected "[1 2 3]" :actual "(quote (1 2 3))"}
|
|
{:suite "list / construct & predicate" :label "list? true" :expected "true" :actual "(list? (list 1 2))"}
|
|
{:suite "list / construct & predicate" :label "list? on conj result" :expected "true" :actual "(list? (conj (list 1) 0))"}
|
|
{:suite "list / construct & predicate" :label "count" :expected "3" :actual "(count (list 1 2 3))"}
|
|
{:suite "list / construct & predicate" :label "empty? true" :expected "true" :actual "(empty? (list))"}
|
|
{:suite "list / construct & predicate" :label "list = vector elts" :expected "true" :actual "(= (list 1 2 3) [1 2 3])"}
|
|
{:suite "list / access & update" :label "first" :expected "1" :actual "(first (list 1 2 3))"}
|
|
{:suite "list / access & update" :label "rest" :expected "[2 3]" :actual "(rest (list 1 2 3))"}
|
|
{:suite "list / access & update" :label "peek is first" :expected "1" :actual "(peek (list 1 2 3))"}
|
|
{:suite "list / access & update" :label "pop drops first" :expected "[2 3]" :actual "(pop (list 1 2 3))"}
|
|
{:suite "list / access & update" :label "conj prepends" :expected "[0 1 2]" :actual "(conj (list 1 2) 0)"}
|
|
{:suite "list / access & update" :label "conj many prepends" :expected "[4 3 1 2]" :actual "(conj (list 1 2) 3 4)"}
|
|
{:suite "list / access & update" :label "cons prepends" :expected "[0 1 2]" :actual "(cons 0 (list 1 2))"}
|
|
{:suite "list / access & update" :label "nth" :expected "20" :actual "(nth (list 10 20 30) 1)"}
|
|
{:suite "list / immutability & performance" :label "conj does not mutate" :expected "true" :actual "(let [l (list 1 2 3) m (conj l 0)] (and (= l [1 2 3]) (= m [0 1 2 3])))"}
|
|
{:suite "list / immutability & performance" :label "reduce conj builds" :expected "[2 1 0]" :actual "(reduce conj (list) (range 3))"}
|
|
{:suite "list / immutability & performance" :label "O(1) conj at scale" :expected "200000" :actual "(count (reduce conj (list) (range 200000)))"}
|
|
{:suite "list / immutability & performance" :label "scale head correct" :expected "199999" :actual "(first (reduce conj (list) (range 200000)))"}
|
|
{:suite "macros / quoting" :label "quote symbol" :expected "(quote a)" :actual "(quote a)"}
|
|
{:suite "macros / quoting" :label "quote list" :expected "[1 2 3]" :actual "(quote (1 2 3))"}
|
|
{:suite "macros / quoting" :label "quote nested" :expected "[1 [2 3]]" :actual "(quote (1 (2 3)))"}
|
|
{:suite "macros / quoting" :label "quote sugar" :expected "'a" :actual "'a"}
|
|
{:suite "macros / quoting" :label "syntax-quote literal" :expected "[1 2]" :actual "`[1 2]"}
|
|
{:suite "macros / quoting" :label "unquote" :expected "[1 2 3]" :actual "(let [x 2] `[1 ~x 3])"}
|
|
{:suite "macros / quoting" :label "unquote-splicing" :expected "[1 2 3 4]" :actual "(let [xs [2 3]] `[1 ~@xs 4])"}
|
|
{:suite "macros / quoting" :label "unquote in list" :expected "[3]" :actual "(let [x 3] `(~x))"}
|
|
{:suite "macros / quoting" :label "syntax-quote symbol qualifies" :expected "true" :actual "(symbol? `foo)"}
|
|
{:suite "macros / defmacro" :label "simple macro" :expected "3" :actual "(do (defmacro m [a b] `(+ ~a ~b)) (m 1 2))"}
|
|
{:suite "macros / defmacro" :label "macro unless" :expected "1" :actual "(do (defmacro unless [c body] `(if ~c nil ~body)) (unless false 1))"}
|
|
{:suite "macros / defmacro" :label "macro with body splice" :expected "6" :actual "(do (defmacro msum [& xs] `(+ ~@xs)) (msum 1 2 3))"}
|
|
{:suite "macros / defmacro" :label "macroexpand-1" :expected "false" :actual "(do (defmacro m [x] `(inc ~x)) (list? (macroexpand-1 '(m 5))))"}
|
|
{:suite "macros / defmacro" :label "gensym unique" :expected "false" :actual "(= (gensym) (gensym))"}
|
|
{:suite "macros / defmacro" :label "gensym# in template" :expected "true" :actual "(do (defmacro m [] `(let [x# 1] x#)) (= 1 (m)))"}
|
|
{:suite "macros / defmacro" :label "#() inside syntax-quote" :expected "[2 4 6]" :actual "(do (defmacro m [] `(mapv #(* % 2) [1 2 3])) (m))"}
|
|
{:suite "macros / defmacro" :label "#() + auto-gensym share in template" :expected "\"ab\"" :actual "(do (defmacro m [] `(let [sb# (StringBuilder.)] (mapv #(.append sb# %) [\"a\" \"b\"]) (.toString sb#))) (m))"}
|
|
{:suite "macros / core-overlay" :label "if-not true branch" :expected ":then" :actual "(if-not false :then :else)"}
|
|
{:suite "macros / core-overlay" :label "if-not else branch" :expected ":else" :actual "(if-not true :then :else)"}
|
|
{:suite "macros / core-overlay" :label "if-not no else" :expected "nil" :actual "(if-not true :then)"}
|
|
{:suite "macros / core-overlay" :label "if-not no else hit" :expected ":then" :actual "(if-not false :then)"}
|
|
{:suite "macros / core-overlay" :label "comment -> nil" :expected "nil" :actual "(comment a b c)"}
|
|
{:suite "macros / core-overlay" :label "comment in do" :expected "42" :actual "(do (comment ignored) 42)"}
|
|
{:suite "macros / core-overlay" :label "if-let then" :expected "6" :actual "(if-let [x 5] (inc x) :none)"}
|
|
{:suite "macros / core-overlay" :label "if-let else" :expected ":none" :actual "(if-let [x nil] (inc x) :none)"}
|
|
{:suite "macros / core-overlay" :label "if-let else scope" :expected "9" :actual "(let [x 9] (if-let [x nil] :t x))"}
|
|
{:suite "macros / core-overlay" :label "if-some zero" :expected "1" :actual "(if-some [x 0] (inc x) :none)"}
|
|
{:suite "macros / core-overlay" :label "if-some nil" :expected ":none" :actual "(if-some [x nil] x :none)"}
|
|
{:suite "macros / core-overlay" :label "when-some multi" :expected "14" :actual "(when-some [x 7] (inc x) (* x 2))"}
|
|
{:suite "macros / core-overlay" :label "when-some nil" :expected "nil" :actual "(when-some [x nil] x)"}
|
|
{:suite "macros / core-overlay" :label "while loop" :expected "3" :actual "(let [a (atom 0)] (while (< @a 3) (swap! a inc)) @a)"}
|
|
{:suite "macros / core-overlay" :label "dotimes sum" :expected "10" :actual "(let [a (atom 0)] (dotimes [i 5] (swap! a + i)) @a)"}
|
|
{:suite "macros / core-overlay" :label "as-> threads" :expected "12" :actual "(as-> 5 x (+ x 1) (* x 2))"}
|
|
{:suite "macros / core-overlay" :label "as-> no forms" :expected "5" :actual "(as-> 5 x)"}
|
|
{:suite "macros / core-overlay" :label "some-> through" :expected "6" :actual "(some-> {:a {:b 5}} :a :b inc)"}
|
|
{:suite "macros / core-overlay" :label "some-> short-circuit" :expected "nil" :actual "(some-> {:a nil} :a :b)"}
|
|
{:suite "macros / core-overlay" :label "some->> through" :expected "9" :actual "(some->> [1 2 3] (map inc) (reduce +))"}
|
|
{:suite "macros / core-overlay" :label "some->> nil" :expected "nil" :actual "(some->> nil (map inc))"}
|
|
{:suite "macros / core-overlay" :label "doto returns obj" :expected "[1 2]" :actual "(deref (doto (atom []) (swap! conj 1) (swap! conj 2)))"}
|
|
{:suite "macros / core-overlay" :label "when-first" :expected "20" :actual "(when-first [x [10 20 30]] (* x 2))"}
|
|
{:suite "macros / core-overlay" :label "when-first empty" :expected "nil" :actual "(when-first [x []] :body)"}
|
|
{:suite "macros / core-overlay" :label "when-first nil coll" :expected "nil" :actual "(when-first [x nil] :body)"}
|
|
{:suite "macros / core-overlay" :label "when-first range" :expected "0" :actual "(when-first [x (range 5)] x)"}
|
|
{:suite "macros / core-overlay" :label "cond->> threads" :expected "12" :actual "(cond->> 5 true (+ 1) false (* 100) true (* 2))"}
|
|
{:suite "macros / core-overlay" :label "cond->> skip" :expected "10" :actual "(cond->> 10 false (+ 1))"}
|
|
{:suite "macros / core-overlay" :label "assert pass" :expected ":ok" :actual "(do (assert (= 1 1)) :ok)"}
|
|
{:suite "macros / core-overlay" :label "assert throws" :expected ":threw" :actual "(try (assert (= 1 2)) (catch :default e :threw))"}
|
|
{:suite "macros / core-overlay" :label "assert message" :expected "\"nope\"" :actual "(try (assert false \"nope\") (catch :default e (ex-message e)))"}
|
|
{:suite "macros / core-overlay" :label "delay value" :expected "42" :actual "(deref (delay 42))"}
|
|
{:suite "macros / core-overlay" :label "delay forces once" :expected "1" :actual "(let [c (atom 0) d (delay (swap! c inc))] @d @d @c)"}
|
|
{:suite "macros / core-overlay" :label "future deref" :expected "9" :actual "(deref (future (* 3 3)))"}
|
|
{:suite "macros / core-overlay" :label "letfn simple" :expected "25" :actual "(letfn [(sq [x] (* x x))] (sq 5))"}
|
|
{:suite "macros / core-overlay" :label "letfn mutual" :expected "true" :actual "(letfn [(ev? [n] (if (zero? n) true (od? (dec n)))) (od? [n] (if (zero? n) false (ev? (dec n))))] (ev? 8))"}
|
|
{:suite "macros / core-overlay" :label "condp match" :expected ":two" :actual "(condp = 2 1 :one 2 :two 3 :three)"}
|
|
{:suite "macros / core-overlay" :label "condp default" :expected ":else" :actual "(condp = 9 1 :one 2 :two :else)"}
|
|
{:suite "macros / core-overlay" :label "condp :>> form" :expected "\"got 2\"" :actual "(condp some [1 2 3] #{0 9} :>> (fn [x] (str \"got \" x)) #{2 6} :>> (fn [x] (str \"got \" x)))"}
|
|
{:suite "macros / core-overlay" :label "condp no match" :expected ":threw" :actual "(try (condp = 9 1 :one) (catch :default e :threw))"}
|
|
{:suite "macros / core-overlay" :label "binding rebinds" :expected "99" :actual "(do (def ^:dynamic *bx* 10) (binding [*bx* 99] *bx*))"}
|
|
{:suite "macros / core-overlay" :label "binding restores" :expected "10" :actual "(do (def ^:dynamic *by* 10) (binding [*by* 99] *by*) *by*)"}
|
|
{:suite "macros / core-overlay" :label "binding seen by fn" :expected "7" :actual "(do (def ^:dynamic *bz* 0) (defn rdz [] *bz*) (binding [*bz* 7] (rdz)))"}
|
|
{:suite "macros / time, with-redefs, macroexpand" :label "time returns value" :expected "3" :actual "(time (+ 1 2))"}
|
|
{:suite "macros / time, with-redefs, macroexpand" :label "with-redefs rebinds" :expected "42" :actual "(do (defn wr-f [] 1) (with-redefs [wr-f (fn [] 42)] (wr-f)))"}
|
|
{:suite "macros / time, with-redefs, macroexpand" :label "with-redefs restores" :expected "1" :actual "(do (defn wr-g [] 1) (with-redefs [wr-g (fn [] 42)]) (wr-g))"}
|
|
{:suite "macros / time, with-redefs, macroexpand" :label "with-redefs restores on throw" :expected "1" :actual "(do (defn wr-h [] 1) (try (with-redefs [wr-h (fn [] 42)] (throw (ex-info \"x\" {}))) (catch :default e nil)) (wr-h))"}
|
|
{:suite "macros / time, with-redefs, macroexpand" :label "with-redefs-fn" :expected "42" :actual "(do (defn wr-i [] 1) (with-redefs-fn {(var wr-i) (fn [] 42)} (fn [] (wr-i))))"}
|
|
{:suite "macros / time, with-redefs, macroexpand" :label "macroexpand full" :expected "true" :actual "(let [e (macroexpand (quote (when-not false 1)))] (= (quote if) (first e)))"}
|
|
{:suite "macros / time, with-redefs, macroexpand" :label "macroexpand non-macro" :expected "[1 2]" :actual "(macroexpand (quote [1 2]))"}
|
|
{:suite "macros / defmacro arity-clause & name metadata" :label "arity-clause form" :expected "10" :actual "(do (defmacro tw ([x] (list (quote *) x 2))) (tw 5))"}
|
|
{:suite "macros / defmacro arity-clause & name metadata" :label "docstring + arity" :expected "15" :actual "(do (defmacro th \"triple\" ([x] (list (quote *) x 3))) (th 5))"}
|
|
{:suite "macros / defmacro arity-clause & name metadata" :label "^{:map} name meta" :expected "7" :actual "(do (defmacro ^{:private true} pm [] 7) (pm))"}
|
|
{:suite "macros / defmacro arity-clause & name metadata" :label "multi-form body" :expected "6" :actual "(do (defmacro mb ([a b] (list (quote +) a b))) (mb 2 4))"}
|
|
{:suite "macros / defmacro multi-arity & attr-map" :label "multi-arity 1" :expected "6" :actual "(do (defmacro ma ([a] (list (quote +) a 1)) ([a b] (list (quote +) a b))) (ma 5))"}
|
|
{:suite "macros / defmacro multi-arity & attr-map" :label "multi-arity 2" :expected "5" :actual "(do (defmacro ma ([a] (list (quote +) a 1)) ([a b] (list (quote +) a b))) (ma 2 3))"}
|
|
{:suite "macros / defmacro multi-arity & attr-map" :label "arity delegates" :expected "[:d nil 9]" :actual "(do (defmacro lg ([m] `(lg :d nil ~m)) ([l t m] (list (quote vector) l t m))) (lg 9))"}
|
|
{:suite "macros / defmacro multi-arity & attr-map" :label "doc + attr-map + params" :expected "10" :actual "(do (defmacro am \"doc\" {:arglists (quote ([x]))} [x] (list (quote inc) x)) (am 9))"}
|
|
{:suite "macros / defmacro multi-arity & attr-map" :label "doc + attr-map + variadic" :expected "6" :actual "(do (defmacro vg \"d\" {:arglists (quote ([& a]))} [& xs] `(+ ~@xs)) (vg 1 2 3))"}
|
|
{:suite "maps / keyword invoke" :label "hit" :expected "1" :actual "(:a {:a 1 :b 2})"}
|
|
{:suite "maps / keyword invoke" :label "miss" :expected "nil" :actual "(:z {:a 1})"}
|
|
{:suite "maps / keyword invoke" :label "miss with default" :expected ":d" :actual "(:z {:a 1} :d)"}
|
|
{:suite "maps / keyword invoke" :label "hit with default" :expected "1" :actual "(:a {:a 1} :d)"}
|
|
{:suite "maps / keyword invoke" :label "on nil" :expected "nil" :actual "(:a nil)"}
|
|
{:suite "maps / keyword invoke" :label "on nil with default" :expected ":d" :actual "(:a nil :d)"}
|
|
{:suite "maps / keyword invoke" :label "nil value is present" :expected "nil" :actual "(:a {:a nil} :d)"}
|
|
{:suite "maps / keyword invoke" :label "false value is present" :expected "false" :actual "(:a {:a false} :d)"}
|
|
{:suite "maps / keyword invoke" :label "on a vector" :expected "nil" :actual "(:a [1 2 3])"}
|
|
{:suite "maps / keyword invoke" :label "on a number" :expected "nil" :actual "(:a 42)"}
|
|
{:suite "maps / keyword invoke" :label "on a sorted map" :expected "2" :actual "(:b (sorted-map :a 1 :b 2))"}
|
|
{:suite "maps / keyword invoke" :label "on assoc result" :expected "3" :actual "(:c (assoc {:a 1} :c 3))"}
|
|
{:suite "maps / keyword invoke" :label "on a record field" :expected "5" :actual "(do (defrecord KFP [x]) (:x (->KFP 5)))"}
|
|
{:suite "maps / keyword invoke" :label "qualified keyword" :expected "1" :actual "(:n/a {:n/a 1})"}
|
|
{:suite "maps / keyword invoke" :label "nested in expr" :expected "6" :actual "(+ (:a {:a 1}) (:b {:b 2}) (:c {:c 3}))"}
|
|
{:suite "maps / keyword invoke" :label "evaluates map expr once" :expected "[2 1]" :actual "(do (def cnt (atom 0)) (let [v (:a (do (swap! cnt inc) {:a 2}))] [v @cnt]))"}
|
|
{:suite "maps / literal construction" :label "basic" :expected "{:a 1, :b 2}" :actual "{:a 1 :b 2}"}
|
|
{:suite "maps / literal construction" :label "empty" :expected "{}" :actual "{}"}
|
|
{:suite "maps / literal construction" :label "computed values" :expected "{:a 3}" :actual "{:a (+ 1 2)}"}
|
|
{:suite "maps / literal construction" :label "nil value kept" :expected "true" :actual "(contains? {:a nil} :a)"}
|
|
{:suite "maps / literal construction" :label "nil value lookup" :expected "nil" :actual "(get {:a nil} :a :d)"}
|
|
{:suite "maps / literal construction" :label "string key" :expected "1" :actual "(get {\"k\" 1} \"k\")"}
|
|
{:suite "maps / literal construction" :label "number key" :expected ":one" :actual "(get {1 :one} 1)"}
|
|
{:suite "maps / literal construction" :label "collection key" :expected ":v" :actual "(get {[1 2] :v} [1 2])"}
|
|
{:suite "maps / literal construction" :label "collection value-equal key" :expected ":v" :actual "(get {[1 2] :v} (vector 1 2))"}
|
|
{:suite "maps / literal construction" :label "computed key" :expected "1" :actual "(get {(keyword \"a\") 1} :a)"}
|
|
{:suite "maps / literal construction" :label "values evaluate in source order" :expected "[1 2 3]" :actual "(do (def log (atom [])) {:a (swap! log conj 1) :b (swap! log conj 2) :c (swap! log conj 3)} (deref log))"}
|
|
{:suite "maps / literal construction" :label "keys evaluate before their values, pairwise" :expected "[:k1 :v1 :k2 :v2]" :actual "(do (def log (atom [])) {(do (swap! log conj :k1) :a) (do (swap! log conj :v1) 1) (do (swap! log conj :k2) :b) (do (swap! log conj :v2) 2)} (deref log))"}
|
|
{:suite "maps / literal construction" :label "source order with a nil value (phm form)" :expected "[1 2 3]" :actual "(do (def log (atom [])) {:a (do (swap! log conj 1) nil) :b (swap! log conj 2) :c (swap! log conj 3)} (deref log))"}
|
|
{:suite "maps / literal construction" :label "source order through syntax-quote" :expected "[2 1]" :actual "(do (def log (atom [])) (defmacro m-p3c [] `{:a ~(list 'swap! 'log 'conj 1) :b ~(list 'swap! 'log 'conj 2)}) (m-p3c) (deref log))"}
|
|
{:suite "maps / literal construction" :label "count" :expected "3" :actual "(count {:a 1 :b 2 :c 3})"}
|
|
{:suite "maps / literal construction" :label "equality with phm" :expected "true" :actual "(= {:a 1 :b 2} (assoc {:a 1} :b 2))"}
|
|
{:suite "maps / literal construction" :label "keys work after assoc" :expected "2" :actual "(:b (assoc {:a 1 :b 2} :c 3))"}
|
|
{:suite "maps / literal construction" :label "literal in fn body" :expected "12" :actual "(do (defn mfp-mk [x] {:v (* x 2)}) (:v (mfp-mk 6)))"}
|
|
{:suite "clojure.math" :label "sqrt" :expected "true" :actual "(< 1.4142 (clojure.math/sqrt 2) 1.4143)"}
|
|
{:suite "clojure.math" :label "pow" :expected "1024" :actual "(long (clojure.math/pow 2 10))"}
|
|
{:suite "clojure.math" :label "tan of 0" :expected "0" :actual "(long (clojure.math/tan 0))"}
|
|
{:suite "clojure.math" :label "round" :expected "3" :actual "(clojure.math/round 2.6)"}
|
|
{:suite "clojure.math" :label "floor" :expected "2.0" :actual "(clojure.math/floor 2.9)"}
|
|
{:suite "clojure.math" :label "signum" :expected "-1.0" :actual "(clojure.math/signum -7.2)"}
|
|
{:suite "clojure.math" :label "to-radians" :expected "true" :actual "(< 3.14 (clojure.math/to-radians 180) 3.15)"}
|
|
{:suite "clojure.math" :label "PI" :expected "true" :actual "(< 3.14 clojure.math/PI 3.15)"}
|
|
{:suite "clojure.math" :label "require + alias" :expected "5" :actual "(do (require '[clojure.math :as m]) (long (m/hypot 3 4)))"}
|
|
{:suite "clojure.math" :label "as a value" :expected "[1 2]" :actual "(mapv (comp long clojure.math/sqrt) [1 4])"}
|
|
{:suite "calls / locals named like core macros" :label "local fn named repeat" :expected "[1 1]" :actual "(let [repeat (fn [x] [x x])] (repeat 1))"}
|
|
{:suite "calls / locals named like core macros" :label "local fn named seq" :expected ":end" :actual "((fn seq [n] (if (pos? n) (seq (dec n)) :end)) 2)"}
|
|
{:suite "calls / locals named like core macros" :label "local fn named loop2" :expected "[2 1]" :actual "(let [with (fn [a b] [b a])] (with 1 2))"}
|
|
{:suite "calls / locals named like core macros" :label "overlay repeat self-call (regression)" :expected "[0 0 0]" :actual "(take 3 (repeat 0))"}
|
|
{:suite "calls / locals named like core macros" :label "closure param called" :expected "42" :actual "((fn [f] (f 41)) inc)"}
|
|
{:suite "calls / locals named like core macros" :label "param holding a keyword (IFn leftover)" :expected "1" :actual "((fn [f] (f {:a 1})) :a)"}
|
|
{:suite "map / construct & predicate" :label "literal" :expected "{:a 1}" :actual "{:a 1}"}
|
|
{:suite "map / construct & predicate" :label "hash-map" :expected "{:b 2, :a 1}" :actual "(hash-map :a 1 :b 2)"}
|
|
{:suite "map / construct & predicate" :label "empty" :expected "{}" :actual "{}"}
|
|
{:suite "map / construct & predicate" :label "map? true" :expected "true" :actual "(map? {:a 1})"}
|
|
{:suite "map / construct & predicate" :label "map? false on vector" :expected "false" :actual "(map? [1 2])"}
|
|
{:suite "map / construct & predicate" :label "count" :expected "2" :actual "(count {:a 1 :b 2})"}
|
|
{:suite "map / construct & predicate" :label "empty? true" :expected "true" :actual "(empty? {})"}
|
|
{:suite "map / construct & predicate" :label "equality order-indep" :expected "true" :actual "(= {:a 1 :b 2} {:b 2 :a 1})"}
|
|
{:suite "map / access" :label "get" :expected "1" :actual "(get {:a 1} :a)"}
|
|
{:suite "map / access" :label "get missing nil" :expected "nil" :actual "(get {:a 1} :z)"}
|
|
{:suite "map / access" :label "get default" :expected ":x" :actual "(get {:a 1} :z :x)"}
|
|
{:suite "map / access" :label "keyword as fn" :expected "1" :actual "(:a {:a 1})"}
|
|
{:suite "map / access" :label "keyword fn default" :expected ":x" :actual "(:z {:a 1} :x)"}
|
|
{:suite "map / access" :label "map as fn" :expected "1" :actual "({:a 1} :a)"}
|
|
{:suite "map / access" :label "get-in" :expected "2" :actual "(get-in {:a {:b 2}} [:a :b])"}
|
|
{:suite "map / access" :label "get-in missing" :expected "nil" :actual "(get-in {:a {}} [:a :b])"}
|
|
{:suite "map / access" :label "contains? key" :expected "true" :actual "(contains? {:a 1} :a)"}
|
|
{:suite "map / access" :label "contains? missing" :expected "false" :actual "(contains? {:a 1} :z)"}
|
|
{:suite "map / access" :label "find returns entry" :expected "[:a 1]" :actual "(find {:a 1} :a)"}
|
|
{:suite "map / access" :label "keys" :expected "true" :actual "(= #{:a :b} (set (keys {:a 1 :b 2})))"}
|
|
{:suite "map / access" :label "vals" :expected "true" :actual "(= #{1 2} (set (vals {:a 1 :b 2})))"}
|
|
{:suite "map / update" :label "assoc adds" :expected "{:a 1, :b 2}" :actual "(assoc {:a 1} :b 2)"}
|
|
{:suite "map / update" :label "assoc overwrites" :expected "{:a 9}" :actual "(assoc {:a 1} :a 9)"}
|
|
{:suite "map / update" :label "assoc many" :expected "{:a 1, :b 2}" :actual "(assoc {} :a 1 :b 2)"}
|
|
{:suite "map / update" :label "dissoc" :expected "{:a 1}" :actual "(dissoc {:a 1 :b 2} :b)"}
|
|
{:suite "map / update" :label "dissoc many" :expected "{:a 1}" :actual "(dissoc {:a 1 :b 2 :c 3} :b :c)"}
|
|
{:suite "map / update" :label "merge" :expected "{:a 1, :b 2}" :actual "(merge {:a 1} {:b 2})"}
|
|
{:suite "map / update" :label "merge overwrites" :expected "{:a 2}" :actual "(merge {:a 1} {:a 2})"}
|
|
{:suite "map / update" :label "merge lattermost wins" :expected "{:a 3}" :actual "(merge {:a 1} {:a 2} {:a 3})"}
|
|
{:suite "map / update" :label "merge no args -> nil" :expected "nil" :actual "(merge)"}
|
|
{:suite "map / update" :label "merge all nil -> nil" :expected "nil" :actual "(merge nil nil)"}
|
|
{:suite "map / update" :label "merge nil arg no-op" :expected "{:a 1}" :actual "(merge {:a 1} nil)"}
|
|
{:suite "map / update" :label "merge nil then map" :expected "{:a 1}" :actual "(merge nil {:a 1})"}
|
|
{:suite "map / update" :label "merge empty + nil" :expected "{}" :actual "(merge {} nil)"}
|
|
{:suite "map / update" :label "merge map-entry (conj)" :expected "{:a 1}" :actual "(merge {} (first {:a 1}))"}
|
|
{:suite "map / update" :label "merge [k v] vector" :expected "{:foo 1}" :actual "(merge {} [:foo 1])"}
|
|
{:suite "map / update" :label "merge collection key" :expected "true" :actual "(= {[2 3] :foo} (merge {[2 3] :foo} nil {}))"}
|
|
{:suite "map / update" :label "merge-with" :expected "{:a 3}" :actual "(merge-with + {:a 1} {:a 2})"}
|
|
{:suite "map / update" :label "update" :expected "{:a 2}" :actual "(update {:a 1} :a inc)"}
|
|
{:suite "map / update" :label "update missing w/ fnil" :expected "{:a 1}" :actual "(update {} :a (fnil inc 0))"}
|
|
{:suite "map / update" :label "update-in" :expected "{:a {:b 2}}" :actual "(update-in {:a {:b 1}} [:a :b] inc)"}
|
|
{:suite "map / update" :label "assoc-in" :expected "{:a {:b 1}}" :actual "(assoc-in {} [:a :b] 1)"}
|
|
{:suite "map / update" :label "select-keys" :expected "{:a 1}" :actual "(select-keys {:a 1 :b 2} [:a])"}
|
|
{:suite "map / update" :label "into onto map" :expected "{:a 1, :b 2}" :actual "(into {:a 1} [[:b 2]])"}
|
|
{:suite "map / update" :label "zipmap" :expected "{:a 1, :b 2}" :actual "(zipmap [:a :b] [1 2])"}
|
|
{:suite "map / iteration & entries" :label "map over entries" :expected "true" :actual "(= #{1 2} (set (map val {:a 1 :b 2})))"}
|
|
{:suite "map / iteration & entries" :label "map keys" :expected "true" :actual "(= #{:a :b} (set (map key {:a 1 :b 2})))"}
|
|
{:suite "map / iteration & entries" :label "reduce over entries" :expected "6" :actual "(reduce (fn [a e] (+ a (val e))) 0 {:a 1 :b 2 :c 3})"}
|
|
{:suite "map / iteration & entries" :label "reduce-kv" :expected "6" :actual "(reduce-kv (fn [a k v] (+ a v)) 0 {:a 1 :b 2 :c 3})"}
|
|
{:suite "map / iteration & entries" :label "destructure entry" :expected "true" :actual "(= [[:a 2]] (into [] (map (fn [[k v]] [k (inc v)]) {:a 1})))"}
|
|
{:suite "map / iteration & entries" :label "first of map is entry" :expected "true" :actual "(let [e (first {:a 1})] (and (= (key e) :a) (= (val e) 1)))"}
|
|
{:suite "map / iteration & entries" :label "map-entry?" :expected "true" :actual "(map-entry? (first {:a 1}))"}
|
|
{:suite "map / iteration & entries" :label "count of nil map" :expected "0" :actual "(count nil)"}
|
|
{:suite "map / iteration & entries" :label "get from nil" :expected "nil" :actual "(get nil :a)"}
|
|
{:suite "map / iteration & entries" :label "immutability" :expected "true" :actual "(let [m {:a 1} n (assoc m :b 2)] (and (= m {:a 1}) (= n {:a 1 :b 2})))"}
|
|
{:suite "map / collection keys (by value)" :label "vector key literal" :expected ":v" :actual "(get {[1 2] :v} [1 2])"}
|
|
{:suite "map / collection keys (by value)" :label "map key literal" :expected ":v" :actual "(get {(hash-map :a 1) :v} {:a 1})"}
|
|
{:suite "map / collection keys (by value)" :label "assoc vector key" :expected ":v" :actual "(get (assoc {} [1 2] :v) [1 2])"}
|
|
{:suite "map / collection keys (by value)" :label "key across repr" :expected ":v" :actual "(get (assoc {} (vec [1 2]) :v) [1 2])"}
|
|
{:suite "map / collection keys (by value)" :label "frequencies of maps" :expected "2" :actual "(get (frequencies [{:a 1} (hash-map :a 1)]) {:a 1})"}
|
|
{:suite "map / collection keys (by value)" :label "group-by collection key" :expected "1" :actual "(count (group-by identity [{:a 1} (hash-map :a 1)]))"}
|
|
{:suite "map / nil inside a collection key" :label "set key w/ nil distinct" :expected "2" :actual "(count {#{nil 1} :a, #{1} :b})"}
|
|
{:suite "map / nil inside a collection key" :label "set key w/ nil neg lookup" :expected "nil" :actual "(get {#{nil 1} :a} #{1})"}
|
|
{:suite "map / nil inside a collection key" :label "set key w/ nil pos lookup" :expected ":a" :actual "(get {#{nil 1} :a} #{nil 1})"}
|
|
{:suite "map / nil inside a collection key" :label "set key just nil distinct" :expected "false" :actual "(= {#{nil} :x} {#{} :x})"}
|
|
{:suite "map / nil inside a collection key" :label "map nil-value key distinct" :expected "2" :actual "(count {{:a nil} 1, {} 2})"}
|
|
{:suite "map / nil inside a collection key" :label "map nil-value key neg" :expected "nil" :actual "(get {{:a nil} 1} {})"}
|
|
{:suite "map / nil inside a collection key" :label "map nil-value key pos" :expected "1" :actual "(get {{:a nil} 1} {:a nil})"}
|
|
{:suite "map / nil inside a collection key" :label "map nil-key key distinct" :expected "2" :actual "(count {{nil :a} 1, {} 2})"}
|
|
{:suite "map / nil inside a collection key" :label "map nil-key key pos" :expected "1" :actual "(get {{nil :a} 1} {nil :a})"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "assoc vec out of bounds" :expected :throws :actual "(assoc [0 1 2] 4 4)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "assoc vec negative" :expected :throws :actual "(assoc [] -1 0)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "assoc vec at count ok" :expected "[1 2 3]" :actual "(assoc [1 2] 2 3)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "dissoc on number" :expected :throws :actual "(dissoc 42 :a)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "dissoc on vector" :expected :throws :actual "(dissoc [1 2] 0)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "dissoc on set" :expected :throws :actual "(dissoc #{:a} :a)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "dissoc nil ok" :expected "nil" :actual "(dissoc nil :a)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "count on number" :expected :throws :actual "(count 1)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "count on keyword" :expected :throws :actual "(count :a)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "count string ok" :expected "3" :actual "(count \"abc\")"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "numerator throws" :expected :throws :actual "(numerator 1)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "denominator throws" :expected :throws :actual "(denominator 2)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "subvec out of range" :expected :throws :actual "(subvec [0 1 2 3] 1 5)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "subvec start>end" :expected :throws :actual "(subvec [0 1 2 3] 3 2)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "subvec ok" :expected "[1 2]" :actual "(subvec [0 1 2 3] 1 3)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "min-key empty" :expected :throws :actual "(apply min-key identity [])"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "merge empty vector" :expected :throws :actual "(merge {} [])"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "merge 1-elem vector" :expected :throws :actual "(merge {} [:foo])"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "merge atomic arg" :expected :throws :actual "(merge {} :foo)"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "merge [k v] ok" :expected "{:foo 1}" :actual "(merge {} [:foo 1])"}
|
|
{:suite "map / strictness (throws like Clojure)" :label "merge maps ok" :expected "{:a 1, :b 2}" :actual "(merge {:a 1} {:b 2})"}
|
|
{:suite "map / map-entry & key ordering" :label "key of entry" :expected ":a" :actual "(key (first {:a 1}))"}
|
|
{:suite "map / map-entry & key ordering" :label "val of entry" :expected "1" :actual "(val (first {:a 1}))"}
|
|
{:suite "map / map-entry & key ordering" :label "key rejects vector" :expected :throws :actual "(key [:a 1])"}
|
|
{:suite "map / map-entry & key ordering" :label "val rejects vector" :expected :throws :actual "(val [:a 1])"}
|
|
{:suite "map / map-entry & key ordering" :label "map-entry? entry" :expected "true" :actual "(map-entry? (first {:a 1}))"}
|
|
{:suite "map / map-entry & key ordering" :label "map-entry? vector" :expected "false" :actual "(map-entry? [:a 1])"}
|
|
{:suite "map / map-entry & key ordering" :label "min-key NaN first" :expected "1" :actual "(min-key identity ##NaN 1)"}
|
|
{:suite "map / map-entry & key ordering" :label "min-key NaN last" :expected "true" :actual "(NaN? (min-key identity 1 ##NaN))"}
|
|
{:suite "map / map-entry & key ordering" :label "min-key NaN three" :expected "true" :actual "(infinite? (min-key identity ##NaN ##-Inf 1))"}
|
|
{:suite "map / map-entry & key ordering" :label "min-key keys nonnum" :expected :throws :actual "(min-key identity \"x\" \"y\")"}
|
|
{:suite "map / map-entry & key ordering" :label "max-key picks max" :expected "[1 2 3]" :actual "(max-key count [1] [1 2 3] [1 2])"}
|
|
{:suite "map / map-entry & key ordering" :label "subvec float trunc" :expected "[0]" :actual "(subvec [0 1 2] 0.5 1.33)"}
|
|
{:suite "map / map-entry & key ordering" :label "subvec NaN start" :expected "[0 1 2]" :actual "(subvec [0 1 2] ##NaN 3)"}
|
|
{:suite "map / map-entry & key ordering" :label "subvec NaN end" :expected "[]" :actual "(subvec [0 1 2] 0 ##NaN)"}
|
|
{:suite "map / nil values preserved" :label "literal contains" :expected "true" :actual "(contains? {:b nil} :b)"}
|
|
{:suite "map / nil values preserved" :label "literal not= empty" :expected "false" :actual "(= {:b nil} {})"}
|
|
{:suite "map / nil values preserved" :label "literal get nil" :expected "nil" :actual "(get {:b nil} :b :x)"}
|
|
{:suite "map / nil values preserved" :label "literal keys incl nil" :expected "true" :actual "(= #{:a :b} (set (keys {:a nil :b 1})))"}
|
|
{:suite "map / nil values preserved" :label "literal count" :expected "2" :actual "(count {:a nil :b 1})"}
|
|
{:suite "map / nil values preserved" :label "literal vals incl nil" :expected "2" :actual "(count (vals {:a nil :b 1}))"}
|
|
{:suite "map / nil values preserved" :label "eval values w/ nil" :expected "3" :actual "(:a {:a (+ 1 2) :b nil})"}
|
|
{:suite "map / nil values preserved" :label "nil key present" :expected "true" :actual "(contains? {nil :v} nil)"}
|
|
{:suite "map / nil values preserved" :label "assoc nil present" :expected "true" :actual "(contains? (assoc {:a 1} :b nil) :b)"}
|
|
{:suite "map / nil values preserved" :label "assoc nil get" :expected "nil" :actual "(get (assoc {:a 1} :b nil) :b :x)"}
|
|
{:suite "map / nil values preserved" :label "assoc overwrite nil" :expected "nil" :actual "(get (assoc {:a 1} :a nil) :a :x)"}
|
|
{:suite "map / nil values preserved" :label "hash-map nil" :expected "true" :actual "(contains? (hash-map :b nil) :b)"}
|
|
{:suite "map / nil values preserved" :label "merge new nil" :expected "true" :actual "(contains? (merge {:a 1} {:b nil}) :b)"}
|
|
{:suite "map / nil values preserved" :label "merge overwrite nil" :expected "nil" :actual "(get (merge {:a 1} {:a nil}) :a :x)"}
|
|
{:suite "map / nil values preserved" :label "merge-with present nil" :expected "true" :actual "(= [nil 1] (get (merge-with (fn [a b] [a b]) {:a nil} {:a 1}) :a))"}
|
|
{:suite "map / nil values preserved" :label "into nil val" :expected "true" :actual "(contains? (into {} [[:a nil]]) :a)"}
|
|
{:suite "map / nil values preserved" :label "conj map nil" :expected "true" :actual "(contains? (conj {:x 1} {:a nil}) :a)"}
|
|
{:suite "map / nil values preserved" :label "zipmap nil" :expected "true" :actual "(contains? (zipmap [:a] [nil]) :a)"}
|
|
{:suite "map / nil values preserved" :label "select-keys nil" :expected "true" :actual "(contains? (select-keys {:a nil} [:a]) :a)"}
|
|
{:suite "map / nil values preserved" :label "get-in present nil" :expected "nil" :actual "(get-in {:a nil} [:a] :x)"}
|
|
{:suite "map / nil values preserved" :label "get-in through nil" :expected ":x" :actual "(get-in {:a nil} [:a :b] :x)"}
|
|
{:suite "map / nil values preserved" :label "dissoc keeps nil" :expected "true" :actual "(contains? (dissoc {:a nil :b 1} :b) :a)"}
|
|
{:suite "map / nil values preserved" :label "reduce-kv sees nil" :expected "true" :actual "(= #{:a :b} (reduce-kv (fn [acc k v] (conj acc k)) #{} {:a nil :b 2}))"}
|
|
{:suite "map / nil values preserved" :label "nil-free stays fast" :expected "true" :actual "(= {:a 1 :b 2} {:b 2 :a 1})"}
|
|
{:suite "map / update-keys & update-vals (1.11)" :label "update-keys" :expected "{\"a\" 1, \"b\" 2}" :actual "(update-keys {:a 1 :b 2} name)"}
|
|
{:suite "map / update-keys & update-vals (1.11)" :label "update-keys empty" :expected "{}" :actual "(update-keys {} inc)"}
|
|
{:suite "map / update-keys & update-vals (1.11)" :label "update-keys nil" :expected "{}" :actual "(update-keys nil str)"}
|
|
{:suite "map / update-keys & update-vals (1.11)" :label "update-keys collide last wins" :expected "1" :actual "(count (update-keys {:a 1 :b 2} (fn [_] :k)))"}
|
|
{:suite "map / update-keys & update-vals (1.11)" :label "update-vals" :expected "{:a 2, :b 3}" :actual "(update-vals {:a 1 :b 2} inc)"}
|
|
{:suite "map / update-keys & update-vals (1.11)" :label "update-vals empty" :expected "{}" :actual "(update-vals {} inc)"}
|
|
{:suite "map / update-keys & update-vals (1.11)" :label "update-vals nil" :expected "{}" :actual "(update-vals nil inc)"}
|
|
{:suite "map / update-keys & update-vals (1.11)" :label "update-vals keeps keys" :expected "[:a :b]" :actual "(sort (keys (update-vals {:a 1 :b 2} inc)))"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "keys" :expected "[:a]" :actual "(keys {:a 1})"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "keys empty map" :expected "nil" :actual "(keys {})"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "keys nil" :expected "nil" :actual "(keys nil)"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "vals" :expected "[1]" :actual "(vals {:a 1})"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "vals empty" :expected "nil" :actual "(vals {})"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "keys sorted order" :expected "[1 2 3]" :actual "(vec (keys (sorted-map 2 :b 1 :a 3 :c)))"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "vals sorted order" :expected "[:a :b :c]" :actual "(vec (vals (sorted-map 2 :b 1 :a 3 :c)))"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "keys/vals zip" :expected "{:a 1, :b 2}" :actual "(zipmap (keys {:a 1 :b 2}) (vals {:a 1 :b 2}))"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? map" :expected "true" :actual "(empty? {})"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? vec" :expected "[true false]" :actual "[(empty? []) (empty? [1])]"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? list" :expected "[true false]" :actual "[(empty? ()) (empty? (list 1))]"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? string" :expected "[true false]" :actual "[(empty? \"\") (empty? \"a\")]"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? nil" :expected "true" :actual "(empty? nil)"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? set" :expected "[true false]" :actual "[(empty? #{}) (empty? #{1})]"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? lazy" :expected "[true false]" :actual "[(empty? (filter pos? [-1])) (empty? (map inc [1]))]"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? lazy nil elem" :expected "false" :actual "(empty? (cons nil nil))"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? sorted" :expected "[true false]" :actual "[(empty? (sorted-map)) (empty? (sorted-set 1))]"}
|
|
{:suite "maps / keys-vals-empty? as overlay fns" :label "empty? number throws" :expected :throws :actual "(empty? 5)"}
|
|
{:suite "map / assoc on nil" :label "assoc nil is a map" :expected "{:a 1}" :actual "(assoc nil :a 1)"}
|
|
{:suite "map / assoc on nil" :label "count of assoc nil" :expected "1" :actual "(count (assoc nil :a 1))"}
|
|
{:suite "map / assoc on nil" :label "assoc-in nested countable" :expected "1" :actual "(count (:a (assoc-in {} [:a :b] 1)))"}
|
|
{:suite "map / assoc on nil" :label "assoc-in deep get" :expected "9" :actual "(get-in (assoc-in {} [:a :b :c] 9) [:a :b :c])"}
|
|
{:suite "map / assoc on nil" :label "seq over assoc-nil map" :expected ":a" :actual "(ffirst (seq (assoc nil :a 1)))"}
|
|
{:suite "map / assoc on nil" :label "keys of assoc-nil map" :expected "[:a]" :actual "(vec (keys (assoc nil :a 1)))"}
|
|
{:suite "map / bulk build boundaries" :label "into = incr at 17" :expected "true" :actual "(= (into {} (map (fn [i] [i (* i 2)]) (range 17))) (reduce (fn [m p] (assoc m (first p) (second p))) {} (map (fn [i] [i (* i 2)]) (range 17))))"}
|
|
{:suite "map / bulk build boundaries" :label "into = incr at 1000" :expected "true" :actual "(= (into {} (map (fn [i] [i (* i 2)]) (range 1000))) (reduce (fn [m p] (assoc m (first p) (second p))) {} (map (fn [i] [i (* i 2)]) (range 1000))))"}
|
|
{:suite "map / bulk build boundaries" :label "into count 1000" :expected "1000" :actual "(count (into {} (map (fn [i] [i i]) (range 1000))))"}
|
|
{:suite "map / bulk build boundaries" :label "into reads back" :expected "999" :actual "(get (into {} (map (fn [i] [i (* i 3)]) (range 1000))) 333)"}
|
|
{:suite "map / bulk build boundaries" :label "into onto non-empty" :expected "9" :actual "(get (into {:a 1} [[:a 9] [:b 2]]) :a)"}
|
|
{:suite "map / bulk build boundaries" :label "into dup last wins" :expected "9" :actual "(get (into {} [[:k 1] [:k 9]]) :k)"}
|
|
{:suite "map / bulk build boundaries" :label "into nil key" :expected ":x" :actual "(get (into {} [[nil :x] [:a 1]]) nil)"}
|
|
{:suite "map / bulk build boundaries" :label "assoc after bulk" :expected "7" :actual "(get (assoc (into {} (map (fn [i] [i i]) (range 100))) :new 7) :new)"}
|
|
{:suite "map / bulk build boundaries" :label "dissoc after bulk" :expected "nil" :actual "(get (dissoc (into {} (map (fn [i] [i i]) (range 100))) 50) 50)"}
|
|
{:suite "map / bulk build boundaries" :label "frequencies count" :expected "3" :actual "(get (frequencies [1 2 2 1 2 1]) 1)"}
|
|
{:suite "map / bulk build boundaries" :label "frequencies coll-key" :expected "2" :actual "(get (frequencies [[1 2] [1 2] [3 4]]) [1 2])"}
|
|
{:suite "map / bulk build boundaries" :label "frequencies nil key" :expected "2" :actual "(get (frequencies [nil nil 1]) nil)"}
|
|
{:suite "map / bulk build boundaries" :label "group-by nil key" :expected "[nil nil]" :actual "(get (group-by identity [nil nil 1]) nil)"}
|
|
{:suite "map / bulk build boundaries" :label "group-by nil count" :expected "2" :actual "(count (group-by identity [nil nil 1]))"}
|
|
{:suite "map / bulk build boundaries" :label "transient nil key" :expected ":x" :actual "(let [t (transient {})] (assoc! t nil :x) (get (persistent! t) nil))"}
|
|
{:suite "map / bulk build boundaries" :label "transient nil get" :expected "true" :actual "(let [t (transient {})] (assoc! t nil :x) (contains? t nil))"}
|
|
{:suite "map / bulk build boundaries" :label "transient nil dissoc" :expected ":gone" :actual "(let [t (transient {})] (assoc! t nil :x) (dissoc! t nil) (get (persistent! t) nil :gone))"}
|
|
{:suite "map / bulk build boundaries" :label "group-by bucket" :expected "[1 3 5]" :actual "(get (group-by odd? (range 1 6)) true)"}
|
|
{:suite "map / bulk build boundaries" :label "group-by big bucket" :expected "true" :actual "(= (group-by even? (range 200)) {true (vec (filter even? (range 200))) false (vec (filter odd? (range 200)))})"}
|
|
{:suite "map / bulk build boundaries" :label "group-by order" :expected "[0 3 6 9]" :actual "(get (group-by (fn [x] (mod x 3)) (range 10)) 0)"}
|
|
{:suite "map / bulk build boundaries" :label "hash-map bulk = incr" :expected "true" :actual "(= (apply hash-map (mapcat (fn [i] [i i]) (range 50))) (reduce (fn [m i] (assoc m i i)) {} (range 50)))"}
|
|
{:suite "metadata / with-meta & meta" :label "meta of bare value" :expected "nil" :actual "(meta [1 2 3])"}
|
|
{:suite "metadata / with-meta & meta" :label "with-meta then meta" :expected "{:a 1}" :actual "(meta (with-meta [1 2 3] {:a 1}))"}
|
|
{:suite "metadata / with-meta & meta" :label "with-meta preserves value" :expected "true" :actual "(= [1 2 3] (with-meta [1 2 3] {:a 1}))"}
|
|
{:suite "metadata / with-meta & meta" :label "with-meta on map" :expected "{:doc \"x\"}" :actual "(meta (with-meta {:k 1} {:doc \"x\"}))"}
|
|
{:suite "metadata / with-meta & meta" :label "vary-meta" :expected "{:a 2}" :actual "(meta (vary-meta (with-meta [1] {:a 1}) update :a inc))"}
|
|
{:suite "metadata / with-meta & meta" :label "vary-meta extra args" :expected "{:a 1, :b 2}" :actual "(meta (vary-meta (with-meta [1] {:a 1}) assoc :b 2))"}
|
|
{:suite "metadata / with-meta & meta" :label "meta reader ^" :expected "{:tag :int}" :actual "(meta ^{:tag :int} [1 2])"}
|
|
{:suite "metadata / with-meta & meta" :label "with-meta on fn ok" :expected "true" :actual "(fn? (with-meta inc {:a 1}))"}
|
|
{:suite "metadata / with-meta & meta" :label "with-meta nil clears" :expected "nil" :actual "(meta (with-meta [1 2 3] nil))"}
|
|
{:suite "metadata / type hints" :label "type hint on param" :expected "\"hi\"" :actual "(do (defn f [^String s] s) (f \"hi\"))"}
|
|
{:suite "metadata / type hints" :label "type hint, extra params" :expected "[1 2]" :actual "(do (defn g [^String x y] [x y]) (g 1 2))"}
|
|
{:suite "metadata / type hints" :label "type hint in let" :expected "6" :actual "(let [^long x 5] (inc x))"}
|
|
{:suite "metadata / type hints" :label "type hint in body" :expected "2" :actual "(let [s \"ab\"] (count ^String s))"}
|
|
{:suite "metadata / type hints" :label "type hint in destructure" :expected "3" :actual "(let [{:keys [^long a]} {:a 3}] a)"}
|
|
{:suite "metadata / type hints" :label "symbol hint -> :tag" :expected "\"String\"" :actual "(:tag (meta (read-string \"^String x\")))"}
|
|
{:suite "metadata / type hints" :label "keyword hint -> true" :expected "true" :actual "(:foo (meta (read-string \"^:foo x\")))"}
|
|
{:suite "metadata / read data metadata" :label "vector data meta" :expected "{:ref true}" :actual "(meta (read-string \"^:ref [:greeting]\"))"}
|
|
{:suite "metadata / read data metadata" :label "map data meta" :expected "{:k 1}" :actual "(meta (read-string \"^{:k 1} {:a 2}\"))"}
|
|
{:suite "metadata / read data metadata" :label "set data meta" :expected "{:s true}" :actual "(meta (read-string \"^:s #{1 2}\"))"}
|
|
{:suite "metadata / read data metadata" :label "nested vector data meta" :expected "{:x true}" :actual "(meta (second (read-string \"[1 ^:x {:a 2}]\")))"}
|
|
{:suite "metadata / read data metadata" :label "collection value unchanged" :expected "[:greeting]" :actual "(read-string \"^:ref [:greeting]\")"}
|
|
{:suite "metadata / coll literal in code keeps meta" :label "vector literal meta" :expected "{:foo true}" :actual "(meta ^:foo [1 2])"}
|
|
{:suite "metadata / coll literal in code keeps meta" :label "map literal meta with expr" :expected "{:a 3}" :actual "(meta ^{:a (+ 1 2)} [1])"}
|
|
{:suite "metadata / coll literal in code keeps meta" :label "map literal value-eval order" :expected "[1 2]" :actual "(let [a (atom [])] ^:t {(do (swap! a conj 1) :a) 1 (do (swap! a conj 2) :b) 2} @a)"}
|
|
{:suite "metadata / *print-meta*" :label "pr-str prefixes ^meta" :expected "\"^{:ref true} [:g]\"" :actual "(binding [*print-meta* true] (pr-str (with-meta [:g] {:ref true})))"}
|
|
{:suite "metadata / *print-meta*" :label "off by default" :expected "\"[:g]\"" :actual "(pr-str (with-meta [:g] {:ref true}))"}
|
|
{:suite "metadata / *print-meta*" :label "symbol meta prefixed" :expected "\"^{:k 1} x\"" :actual "(binding [*print-meta* true] (pr-str (with-meta (quote x) {:k 1})))"}
|
|
{:suite "metadata / *print-meta*" :label "print then read round-trips" :expected "{:ref true}" :actual "(meta (read-string (binding [*print-meta* true] (pr-str (with-meta [:g] {:ref true})))))"}
|
|
{:suite "metadata / clojure.walk preserves meta" :label "postwalk keeps vector meta" :expected "{:ref true}" :actual "(do (require (quote [clojure.walk :as w])) (meta (w/postwalk identity (with-meta [:b] {:ref true}))))"}
|
|
{:suite "metadata / clojure.walk preserves meta" :label "postwalk keeps map meta" :expected "{:m 1}" :actual "(do (require (quote [clojure.walk :as w])) (meta (w/postwalk identity (with-meta {:a 2} {:m 1}))))"}
|
|
{:suite "metadata / clojure.edn preserves meta" :label "edn vector meta" :expected "{:ref true}" :actual "(do (require (quote [clojure.edn :as e1])) (meta (e1/read-string \"^:ref [:greeting]\")))"}
|
|
{:suite "metadata / clojure.edn preserves meta" :label "edn map meta" :expected "{:m true}" :actual "(do (require (quote [clojure.edn :as e1])) (meta (e1/read-string \"^:m {:a 1}\")))"}
|
|
{:suite "metadata / clojure.edn preserves meta" :label "edn set meta" :expected "{:s true}" :actual "(do (require (quote [clojure.edn :as e1])) (meta (e1/read-string \"^:s #{1}\")))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "empty keeps vector meta" :expected "{:k 9}" :actual "(meta (empty (with-meta [1] {:k 9})))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "empty keeps map meta" :expected "{:k 9}" :actual "(meta (empty (with-meta {:a 1} {:k 9})))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "empty keeps set meta" :expected "{:k 9}" :actual "(meta (empty (with-meta #{1} {:k 9})))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "empty keeps list meta" :expected "{:k 9}" :actual "(meta (empty (with-meta (list 1) {:k 9})))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "into empty keeps meta" :expected "{:k 9}" :actual "(meta (into (empty (with-meta {:a 1} {:k 9})) {:b 2}))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "into target meta" :expected "{:k 9}" :actual "(meta (into (with-meta [] {:k 9}) [1 2]))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "conj on vector" :expected "{:k 9}" :actual "(meta (conj (with-meta [1] {:k 9}) 2))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "conj on list" :expected "{:k 9}" :actual "(meta (conj (with-meta (list 1) {:k 9}) 2))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "assoc on map" :expected "{:k 9}" :actual "(meta (assoc (with-meta {:a 1} {:k 9}) :b 2))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "dissoc on map" :expected "{:k 9}" :actual "(meta (dissoc (with-meta {:a 1 :c 3} {:k 9}) :c))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "disj on set" :expected "{:k 9}" :actual "(meta (disj (with-meta #{1 2} {:k 9}) 2))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "pop on vector" :expected "{:k 9}" :actual "(meta (pop (with-meta [1 2] {:k 9})))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "op without meta is nil" :expected "nil" :actual "(meta (conj [1] 2))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "value preserved through conj" :expected "[1 2]" :actual "(conj (with-meta [1] {:k 9}) 2)"}
|
|
{:suite "metadata / collection ops preserve meta" :label "empty list singleton unaffected" :expected "nil" :actual "(do (with-meta () {:leak 1}) (meta ()))"}
|
|
{:suite "metadata / collection ops preserve meta" :label "empty vector literal unaffected" :expected "nil" :actual "(do (with-meta [] {:leak 1}) (meta []))"}
|
|
{:suite "metadata / def metadata" :label "^:dynamic var binds" :expected "9" :actual "(do (def ^:dynamic *d* 1) (binding [*d* 9] *d*))"}
|
|
{:suite "metadata / def metadata" :label "^:private on var" :expected "true" :actual "(do (def ^:private pv 1) (:private (meta (var pv))))"}
|
|
{:suite "metadata / def metadata" :label "^Type tag on var" :expected "java.lang.String" :actual "(do (def ^String tv \"a\") (:tag (meta (var tv))))"}
|
|
{:suite "metadata / def metadata" :label "^{:doc} on var" :expected "\"hi\"" :actual "(do (def ^{:doc \"hi\"} dv 1) (:doc (meta (var dv))))"}
|
|
{:suite "metadata / def metadata" :label "(def name doc val) doc" :expected "\"d\"" :actual "(do (def dd \"d\" 5) (:doc (meta (var dd))))"}
|
|
{:suite "core / find-keyword + inst-ms*" :label "find-keyword" :expected ":a" :actual "(find-keyword \"a\")"}
|
|
{:suite "core / find-keyword + inst-ms*" :label "find-keyword 2-arity" :expected ":n/a" :actual "(find-keyword \"n\" \"a\")"}
|
|
{:suite "core / find-keyword + inst-ms*" :label "find-keyword = keyword" :expected "true" :actual "(= (find-keyword \"x\") :x)"}
|
|
{:suite "core / find-keyword + inst-ms*" :label "inst-ms*" :expected "true" :actual "(= (inst-ms* #inst \"2020-01-01T00:00:00Z\") (inst-ms #inst \"2020-01-01T00:00:00Z\"))"}
|
|
{:suite "core / find-keyword + inst-ms*" :label "inst-ms* value" :expected "0" :actual "(inst-ms* #inst \"1970-01-01T00:00:00Z\")"}
|
|
{:suite "core / with-local-vars" :label "var-get initial" :expected "1" :actual "(with-local-vars [x 1] (var-get x))"}
|
|
{:suite "core / with-local-vars" :label "var-set" :expected "2" :actual "(with-local-vars [x 1] (var-set x 2) (var-get x))"}
|
|
{:suite "core / with-local-vars" :label "two vars" :expected "[1 2]" :actual "(with-local-vars [a 1 b 2] [(var-get a) (var-get b)])"}
|
|
{:suite "core / with-local-vars" :label "vars are values" :expected "5" :actual "(with-local-vars [x 0] (let [bump (fn [v] (var-set v (+ 5 (var-get v))))] (bump x) (var-get x)))"}
|
|
{:suite "core / with-local-vars" :label "init sees outer" :expected "3" :actual "(let [y 3] (with-local-vars [x y] (var-get x)))"}
|
|
{:suite "core / with-local-vars" :label "body result" :expected ":done" :actual "(with-local-vars [x 1] :done)"}
|
|
{:suite "core / with-open" :label "body result" :expected ":r" :actual "(let [log (atom [])] (with-open [c {:close (fn [] (swap! log conj :closed))}] :r))"}
|
|
{:suite "core / with-open" :label "close runs" :expected "[:closed]" :actual "(let [log (atom [])] (with-open [c {:close (fn [] (swap! log conj :closed))}] :r) (deref log))"}
|
|
{:suite "core / with-open" :label "close on throw" :expected "[]" :actual "(let [log (atom [])] (try (with-open [c {:close (fn [] (swap! log conj :closed))}] (throw (ex-info \"boom\" {}))) (catch Exception e nil)) (deref log))"}
|
|
{:suite "core / with-open" :label "nested close order" :expected "[:inner :outer]" :actual "(let [log (atom [])] (with-open [a {:close (fn [] (swap! log conj :outer))} b {:close (fn [] (swap! log conj :inner))}] :r) (deref log))"}
|
|
{:suite "core / with-open" :label "zero bindings" :expected ":r" :actual "(with-open [] :r)"}
|
|
{:suite "core / with-open" :label "binding visible" :expected "5" :actual "(with-open [c {:close (fn [] nil) :v 5}] (:v c))"}
|
|
{:suite "core / with-precision" :label "body evaluates" :expected "3.14" :actual "(with-precision 3 3.14)"}
|
|
{:suite "core / with-precision" :label "multiple body forms" :expected "2" :actual "(with-precision 10 1 2)"}
|
|
{:suite "core / with-precision" :label "rounding arg accepted" :expected "1.5" :actual "(with-precision 4 :rounding :half-up 1.5)"}
|
|
{:suite "core / with-precision" :label "arithmetic" :expected "2" :actual "(with-precision 5 (+ 1 1))"}
|
|
{:suite "core / read+string" :label "form and text" :expected "true" :actual "(let [[v s] (with-in-str \"42 rest\" (read+string))] (and (= v 42) (string? s)))"}
|
|
{:suite "core / read+string" :label "form value" :expected "(quote (+ 1 2))" :actual "(first (with-in-str \"(+ 1 2)\" (read+string)))"}
|
|
{:suite "core / read+string" :label "text covers the form" :expected "true" :actual "(let [[v s] (with-in-str \" [1 2] tail\" (read+string))] (and (= v [1 2]) (> (count s) 3)))"}
|
|
{:suite "core / read+string" :label "advances the stream" :expected "[1 2]" :actual "(with-in-str \"1 2\" [(first (read+string)) (first (read+string))])"}
|
|
{:suite "core / read+string" :label "EOF throws" :expected :throws :actual "(with-in-str \"\" (read+string))"}
|
|
{:suite "core / read+string" :label "eof-value arity" :expected ":done" :actual "(first (with-in-str \"\" (read+string *in* false :done)))"}
|
|
{:suite "core / extenders" :label "lists extended type" :expected "[]" :actual "(do (defprotocol Px (pm [x])) (defrecord Rx [] Px (pm [x] 1)) (mapv str (extenders Px)))"}
|
|
{:suite "core / extenders" :label "nil when none" :expected "nil" :actual "(do (defprotocol Py (pn [x])) (extenders Py))"}
|
|
{:suite "core / extenders" :label "seq of tags" :expected "nil" :actual "(do (defprotocol Pz (pz [x])) (defrecord Rz [] Pz (pz [x] 1)) (and (seq (extenders Pz)) (= 1 (count (extenders Pz)))))"}
|
|
{:suite "multimethods / dispatch" :label "dispatch on value" :expected "\"two\"" :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") (defmethod f 2 [_] \"two\") (f 2))"}
|
|
{:suite "multimethods / dispatch" :label "dispatch on keyword fn" :expected "\"circle\"" :actual "(do (defmulti area :shape) (defmethod area :circle [_] \"circle\") (area {:shape :circle}))"}
|
|
{:suite "multimethods / dispatch" :label ":default method" :expected "\"other\"" :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") (defmethod f :default [_] \"other\") (f 99))"}
|
|
{:suite "multimethods / dispatch" :label "no match throws" :expected :throws :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") (f 99))"}
|
|
{:suite "multimethods / dispatch" :label "multiple args" :expected "5" :actual "(do (defmulti g (fn [a b] a)) (defmethod g :add [_ b] b) (g :add 5))"}
|
|
{:suite "multimethods / dispatch" :label "get-method" :expected "\"one\"" :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") ((get-method f 1) 1))"}
|
|
{:suite "multimethods / dispatch" :label "remove-method" :expected :throws :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") (remove-method f 1) (f 1))"}
|
|
{:suite "multimethods / dispatch" :label "methods" :expected "\"one\"" :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") ((get (methods f) 1) 1))"}
|
|
{:suite "multimethods / dispatch" :label "methods count" :expected "2" :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") (defmethod f 2 [_] \"two\") (count (methods f)))"}
|
|
{:suite "multimethods / dispatch" :label "remove-all-methods" :expected :throws :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") (defmethod f 2 [_] \"two\") (remove-all-methods f) (f 1))"}
|
|
{:suite "multimethods / dispatch" :label "remove-all-methods empties the table" :expected "0" :actual "(do (defmulti f identity) (defmethod f 1 [_] \"one\") (remove-all-methods f) (count (methods f)))"}
|
|
{:suite "multimethods / hierarchies" :label "derive + isa?" :expected "true" :actual "(do (derive ::child ::parent) (isa? ::child ::parent))"}
|
|
{:suite "multimethods / hierarchies" :label "isa? reflexive" :expected "true" :actual "(isa? ::x ::x)"}
|
|
{:suite "multimethods / hierarchies" :label "isa? unrelated" :expected "false" :actual "(do (derive ::a ::b) (isa? ::a ::c))"}
|
|
{:suite "multimethods / hierarchies" :label "parents" :expected "true" :actual "(do (derive ::c ::p) (contains? (parents ::c) ::p))"}
|
|
{:suite "multimethods / hierarchies" :label "ancestors" :expected "true" :actual "(do (derive ::c ::p) (derive ::p ::g) (contains? (ancestors ::c) ::g))"}
|
|
{:suite "multimethods / hierarchies" :label "descendants" :expected "true" :actual "(do (derive ::c ::p) (contains? (descendants ::p) ::c))"}
|
|
{:suite "multimethods / hierarchies" :label "dispatch via hierarchy" :expected "\"animal\"" :actual "(do (derive ::dog ::animal) (defmulti speak identity) (defmethod speak ::animal [_] \"animal\") (speak ::dog))"}
|
|
{:suite "multimethods / hierarchies" :label "custom :default key" :expected ":unknown" :actual "(do (defmulti classify :type :default :other) (defmethod classify :a [_] :alpha) (defmethod classify :other [_] :unknown) (classify {:type :zzz}))"}
|
|
{:suite "multimethods / hierarchies" :label "explicit :hierarchy" :expected "\"a\"" :actual "(do (def h (derive (make-hierarchy) ::dog ::animal)) (defmulti snd identity :hierarchy h) (defmethod snd ::animal [_] \"a\") (snd ::dog))"}
|
|
{:suite "multimethods / prefer-method" :label "preference picks the winner" :expected ":rect" :actual "(do (derive :p/sq :p/rect) (derive :p/sq :p/shape) (defmulti pm1 identity) (defmethod pm1 :p/rect [x] :rect) (defmethod pm1 :p/shape [x] :shape) (prefer-method pm1 :p/rect :p/shape) (pm1 :p/sq))"}
|
|
{:suite "multimethods / prefer-method" :label "reverse preference" :expected ":shape" :actual "(do (derive :q/sq :q/rect) (derive :q/sq :q/shape) (defmulti pm2 identity) (defmethod pm2 :q/rect [x] :rect) (defmethod pm2 :q/shape [x] :shape) (prefer-method pm2 :q/shape :q/rect) (pm2 :q/sq))"}
|
|
{:suite "multimethods / prefer-method" :label "ambiguity throws" :expected :throws :actual "(do (derive :r/sq :r/rect) (derive :r/sq :r/shape) (defmulti pm3 identity) (defmethod pm3 :r/rect [x] :rect) (defmethod pm3 :r/shape [x] :shape) (pm3 :r/sq))"}
|
|
{:suite "multimethods / prefer-method" :label "isa dominance needs no preference" :expected ":child" :actual "(do (derive :s/c :s/p) (defmulti pm4 identity) (defmethod pm4 :s/c [x] :child) (defmethod pm4 :s/p [x] :parent) (pm4 :s/c))"}
|
|
{:suite "multimethods / prefer-method" :label "prefers map shape" :expected "true" :actual "(do (defmulti pm5 identity) (defmethod pm5 :a [x] 1) (defmethod pm5 :b [x] 2) (prefer-method pm5 :a :b) (contains? (get (prefers pm5) :a) :b))"}
|
|
{:suite "multimethods / prefer-method" :label "exact match needs no preference" :expected ":exact" :actual "(do (derive :t/sq :t/rect) (defmulti pm6 identity) (defmethod pm6 :t/sq [x] :exact) (defmethod pm6 :t/rect [x] :parent) (pm6 :t/sq))"}
|
|
{:suite "multimethods / docstring & value-based table ops" :label "defmulti docstring" :expected "\"A\"" :actual "(do (defmulti gd \"the dispatcher\" identity) (defmethod gd :a [_] \"A\") (gd :a))"}
|
|
{:suite "multimethods / docstring & value-based table ops" :label "defmulti doc+default" :expected "\"d\"" :actual "(do (defmulti gx \"doc\" identity) (defmethod gx :default [_] \"d\") (gx :anything))"}
|
|
{:suite "multimethods / docstring & value-based table ops" :label "methods on value" :expected "2" :actual "(do (defmulti gm identity) (defmethod gm 1 [_] :one) (defmethod gm 2 [_] :two) (count (methods gm)))"}
|
|
{:suite "multimethods / docstring & value-based table ops" :label "get-method on value" :expected "true" :actual "(do (defmulti gg identity) (defmethod gg :a [_] :x) (fn? (get-method gg :a)))"}
|
|
{:suite "namespaces / def & vars" :label "def + deref" :expected "5" :actual "(do (def x 5) x)"}
|
|
{:suite "namespaces / def & vars" :label "def returns var" :expected "true" :actual "(var? (def y 1))"}
|
|
{:suite "namespaces / def & vars" :label "declare then def" :expected "2" :actual "(do (declare z) (def z 2) z)"}
|
|
{:suite "namespaces / def & vars" :label "var special form" :expected "true" :actual "(var? (var +))"}
|
|
{:suite "namespaces / def & vars" :label "var sugar #'" :expected "true" :actual "(var? #'+)"}
|
|
{:suite "namespaces / def & vars" :label "var-get" :expected "5" :actual "(do (def w 5) (var-get #'w))"}
|
|
{:suite "namespaces / def & vars" :label "defn defines fn" :expected "3" :actual "(do (defn f [x] (inc x)) (f 2))"}
|
|
{:suite "namespaces / def & vars" :label "def with docstring" :expected "7" :actual "(do (def d \"a doc\" 7) d)"}
|
|
{:suite "namespaces / def & vars" :label "dynamic var binding" :expected "2" :actual "(do (def ^:dynamic *x* 1) (binding [*x* 2] *x*))"}
|
|
{:suite "namespaces / def & vars" :label "binding restores" :expected "1" :actual "(do (def ^:dynamic *y* 1) (binding [*y* 9] nil) *y*)"}
|
|
{:suite "namespaces / def & vars" :label "var-set in binding" :expected "5" :actual "(do (def ^:dynamic *z* 1) (binding [*z* 0] (var-set (var *z*) 5) *z*))"}
|
|
{:suite "namespaces / ns operations" :label "in-ns switches" :expected "true" :actual "(do (in-ns 'my.ns) (symbol? 'x))"}
|
|
{:suite "namespaces / ns operations" :label "ns form + alias" :expected "\"HI\"" :actual "(do (ns my.app (:require [clojure.string :as s])) (s/upper-case \"hi\"))"}
|
|
{:suite "namespaces / ns operations" :label "ns :use refers all" :expected "9" :actual "(do (ns src.lib) (def helper 9) (ns dst.app (:use [src.lib])) helper)"}
|
|
{:suite "namespaces / ns operations" :label "standalone use" :expected "7" :actual "(do (ns src.l2) (def k 7) (in-ns 'dst.a2) (use '[src.l2]) k)"}
|
|
{:suite "namespaces / ns operations" :label "ns-name" :expected "true" :actual "(do (require (quote [clojure.string])) (= 'clojure.string (ns-name (find-ns 'clojure.string))))"}
|
|
{:suite "namespaces / ns operations" :label "find-ns existing" :expected "true" :actual "(some? (find-ns 'clojure.core))"}
|
|
{:suite "namespaces / ns operations" :label "find-ns missing" :expected "nil" :actual "(find-ns 'does.not.exist)"}
|
|
{:suite "namespaces / ns operations" :label "resolve var" :expected "true" :actual "(var? (resolve '+))"}
|
|
{:suite "namespaces / ns operations" :label "resolve missing" :expected "nil" :actual "(resolve 'totally-undefined-xyz)"}
|
|
{:suite "namespaces / require & refer" :label "require :as" :expected "\"AB\"" :actual "(do (require '[clojure.string :as s]) (s/upper-case \"ab\"))"}
|
|
{:suite "namespaces / require & refer" :label "require :refer" :expected "true" :actual "(do (require '[clojure.string :refer [blank?]]) (blank? \"\"))"}
|
|
{:suite "namespaces / require & refer" :label "require :as + :refer" :expected "true" :actual "(do (require '[clojure.string :as s :refer [blank?]]) (and (blank? \"\") (= \"X\" (s/upper-case \"x\"))))"}
|
|
{:suite "namespaces / require & refer" :label "require clojure.set" :expected "#{1 3 2}" :actual "(do (require '[clojure.set :as set]) (set/union #{1 2} #{3}))"}
|
|
{:suite "namespaces / require & refer" :label "require clojure.walk" :expected "{:a 2}" :actual "(do (require '[clojure.walk :as w]) (w/postwalk (fn [x] (if (number? x) (inc x) x)) {:a 1}))"}
|
|
{:suite "namespaces / require & refer" :label "walk keywordize-keys" :expected "{:a 1}" :actual "(do (require '[clojure.walk :as w]) (w/keywordize-keys {\"a\" 1}))"}
|
|
{:suite "namespaces / require & refer" :label "walk stringify-keys" :expected "true" :actual "(do (require '[clojure.walk :as w]) (= {\"a\" 1} (w/stringify-keys {:a 1})))"}
|
|
{:suite "namespaces / require & refer" :label "require missing lib throws" :expected :throws :actual "(require '[no.such.lib])"}
|
|
{:suite "namespaces / require & refer" :label "use missing lib throws" :expected :throws :actual "(use 'no.such.lib)"}
|
|
{:suite "namespaces / require & refer" :label "require of in-session ns ok" :expected "1" :actual "(do (ns made.here) (def x 1) (require '[made.here]) made.here/x)"}
|
|
{:suite "namespaces / alias, ns-unalias, ns-publics" :label "alias + use" :expected "\"1,2\"" :actual "(do (require (quote clojure.string)) (alias (quote st) (quote clojure.string)) (st/join \",\" [1 2]))"}
|
|
{:suite "namespaces / alias, ns-unalias, ns-publics" :label "ns-unalias removes" :expected "true" :actual "(do (require (quote clojure.string)) (alias (quote st2) (quote clojure.string)) (ns-unalias (quote user) (quote st2)) (nil? (get (ns-aliases (quote user)) (quote st2))))"}
|
|
{:suite "namespaces / alias, ns-unalias, ns-publics" :label "ns-publics has var" :expected "true" :actual "(do (def npv 1) (some? (get (ns-publics (quote user)) (quote npv))))"}
|
|
{:suite "namespaces / alias, ns-unalias, ns-publics" :label "newline returns nil" :expected "nil" :actual "(newline)"}
|
|
{:suite "namespaces / error inside a fn must not leak its defining ns" :label "alias survives a throwing stdlib call" :expected "\"A\"" :actual "(do (require (quote [clojure.string :as s9])) (try (s9/join nil nil nil) (catch Exception e nil)) (s9/upper-case \"a\"))"}
|
|
{:suite "namespaces / error inside a fn must not leak its defining ns" :label "*ns* restored after throw" :expected "\"user\"" :actual "(do (require (quote [clojure.walk :as w9])) (try (w9/postwalk nil nil nil) (catch Exception e nil)) (str *ns*))"}
|
|
{:suite "namespaces / unified alias store" :label "require :as registers the alias" :expected "1" :actual "(do (require (quote [clojure.string :as st1])) (count (filter (fn [[a n]] (= (str a) \"st1\")) (ns-aliases))))"}
|
|
{:suite "namespaces / unified alias store" :label "aliased call resolves" :expected "\"A\"" :actual "(do (require (quote [clojure.string :as st2])) (st2/upper-case \"a\"))"}
|
|
{:suite "namespaces / unified alias store" :label "alias fn registers + resolves" :expected "\"B\"" :actual "(do (require (quote [clojure.string])) (alias (quote st3) (quote clojure.string)) (st3/upper-case \"b\"))"}
|
|
{:suite "namespaces / unified alias store" :label "alias fn visible to ns-aliases" :expected "true" :actual "(do (require (quote [clojure.string])) (alias (quote st4) (quote clojure.string)) (pos? (count (filter (fn [[a n]] (= (str a) \"st4\")) (ns-aliases)))))"}
|
|
{:suite "namespaces / unified alias store" :label "ns-unalias removes both views" :expected "[0 false]" :actual "(do (require (quote [clojure.string :as st5])) (ns-unalias (quote user) (quote st5)) [(count (filter (fn [[a n]] (= (str a) \"st5\")) (ns-aliases))) (boolean (resolve (quote st5/upper-case)))])"}
|
|
{:suite "namespaces / unified alias store" :label "ns-resolve through alias" :expected "true" :actual "(do (require (quote [clojure.string :as st6])) (var? (ns-resolve (quote user) (quote st6/upper-case))))"}
|
|
{:suite "namespaces / unified alias store" :label "empty ns-aliases is a map" :expected "true" :actual "(map? (ns-aliases (quote clojure.core)))"}
|
|
{:suite "*ns* / identity & printing" :label "str of *ns*" :expected "\"user\"" :actual "(str *ns*)"}
|
|
{:suite "*ns* / identity & printing" :label "ns-name of *ns*" :expected "(quote user)" :actual "(ns-name *ns*)"}
|
|
{:suite "*ns* / identity & printing" :label "*ns* is find-ns" :expected "true" :actual "(= (ns-name *ns*) (ns-name (find-ns (quote user))))"}
|
|
{:suite "*ns* / identity & printing" :label "*ns* not a map" :expected "false" :actual "(map? *ns*)"}
|
|
{:suite "*ns* / identity & printing" :label "tracks in-ns" :expected "\"jolt.test-ns-a\"" :actual "(do (in-ns (quote jolt.test-ns-a)) (str *ns*))"}
|
|
{:suite "*ns* / identity & printing" :label "in-ns returns ns" :expected "\"jolt.test-ns-b\"" :actual "(str (in-ns (quote jolt.test-ns-b)))"}
|
|
{:suite "*ns* / identity & printing" :label "usable with ns fns" :expected "true" :actual "(do (require (quote clojure.string)) (alias (quote nsv) (quote clojure.string)) (some? (get (ns-aliases *ns*) (quote nsv))))"}
|
|
{:suite "*ns* / identity & printing" :label "ns-unalias via *ns*" :expected "true" :actual "(do (require (quote clojure.string)) (alias (quote nsw) (quote clojure.string)) (ns-unalias *ns* (quote nsw)) (nil? (get (ns-aliases *ns*) (quote nsw))))"}
|
|
{:suite "numbers / arithmetic" :label "add" :expected "6" :actual "(+ 1 2 3)"}
|
|
{:suite "numbers / arithmetic" :label "add zero args" :expected "0" :actual "(+)"}
|
|
{:suite "numbers / arithmetic" :label "subtract" :expected "5" :actual "(- 10 3 2)"}
|
|
{:suite "numbers / arithmetic" :label "negate" :expected "-5" :actual "(- 5)"}
|
|
{:suite "numbers / arithmetic" :label "multiply" :expected "24" :actual "(* 2 3 4)"}
|
|
{:suite "numbers / arithmetic" :label "multiply zero args" :expected "1" :actual "(*)"}
|
|
{:suite "numbers / arithmetic" :label "divide" :expected "2" :actual "(/ 10 5)"}
|
|
{:suite "numbers / arithmetic" :label "divide to fraction" :expected "1/2" :actual "(/ 1 2)"}
|
|
{:suite "numbers / arithmetic" :label "inc" :expected "6" :actual "(inc 5)"}
|
|
{:suite "numbers / arithmetic" :label "dec" :expected "4" :actual "(dec 5)"}
|
|
{:suite "numbers / arithmetic" :label "quot" :expected "3" :actual "(quot 10 3)"}
|
|
{:suite "numbers / arithmetic" :label "rem" :expected "1" :actual "(rem 10 3)"}
|
|
{:suite "numbers / arithmetic" :label "mod" :expected "2" :actual "(mod -1 3)"}
|
|
{:suite "numbers / arithmetic" :label "rem negative" :expected "-1" :actual "(rem -1 3)"}
|
|
{:suite "numbers / arithmetic" :label "max" :expected "9" :actual "(max 3 9 1)"}
|
|
{:suite "numbers / arithmetic" :label "min" :expected "1" :actual "(min 3 9 1)"}
|
|
{:suite "numbers / arithmetic" :label "abs" :expected "5" :actual "(abs -5)"}
|
|
{:suite "numbers / arithmetic" :label "promoting + alias" :expected "3" :actual "(+' 1 2)"}
|
|
{:suite "numbers / arithmetic" :label "inc' alias" :expected "6" :actual "(inc' 5)"}
|
|
{:suite "numbers / comparison" :label "less than" :expected "true" :actual "(< 1 2 3)"}
|
|
{:suite "numbers / comparison" :label "less than false" :expected "false" :actual "(< 1 3 2)"}
|
|
{:suite "numbers / comparison" :label "greater than" :expected "true" :actual "(> 3 2 1)"}
|
|
{:suite "numbers / comparison" :label "<=" :expected "true" :actual "(<= 1 1 2)"}
|
|
{:suite "numbers / comparison" :label ">=" :expected "true" :actual "(>= 3 3 2)"}
|
|
{:suite "numbers / comparison" :label "= numbers" :expected "true" :actual "(= 2 2)"}
|
|
{:suite "numbers / comparison" :label "= different" :expected "false" :actual "(= 2 3)"}
|
|
{:suite "numbers / comparison" :label "== numeric" :expected "true" :actual "(== 2 2)"}
|
|
{:suite "numbers / comparison" :label "not=" :expected "true" :actual "(not= 1 2)"}
|
|
{:suite "numbers / comparison" :label "compare less" :expected "-1" :actual "(compare 1 2)"}
|
|
{:suite "numbers / comparison" :label "compare equal" :expected "0" :actual "(compare 1 1)"}
|
|
{:suite "numbers / comparison" :label "compare greater" :expected "1" :actual "(compare 2 1)"}
|
|
{:suite "numbers / predicates" :label "zero?" :expected "true" :actual "(zero? 0)"}
|
|
{:suite "numbers / predicates" :label "pos?" :expected "true" :actual "(pos? 5)"}
|
|
{:suite "numbers / predicates" :label "neg?" :expected "true" :actual "(neg? -5)"}
|
|
{:suite "numbers / predicates" :label "even?" :expected "true" :actual "(even? 4)"}
|
|
{:suite "numbers / predicates" :label "odd?" :expected "true" :actual "(odd? 3)"}
|
|
{:suite "numbers / predicates" :label "number?" :expected "true" :actual "(number? 5)"}
|
|
{:suite "numbers / predicates" :label "number? false" :expected "false" :actual "(number? :a)"}
|
|
{:suite "numbers / predicates" :label "int?" :expected "true" :actual "(int? 5)"}
|
|
{:suite "numbers / predicates" :label "pos-int?" :expected "true" :actual "(pos-int? 5)"}
|
|
{:suite "numbers / predicates" :label "neg-int?" :expected "true" :actual "(neg-int? -5)"}
|
|
{:suite "numbers / predicates" :label "nat-int? zero" :expected "true" :actual "(nat-int? 0)"}
|
|
{:suite "numbers / predicates" :label "nat-int? neg" :expected "false" :actual "(nat-int? -1)"}
|
|
{:suite "numbers / predicates" :label "ratio? false" :expected "false" :actual "(ratio? 5)"}
|
|
{:suite "numbers / floats & symbolic values" :label "read ##Inf" :expected "true" :actual "(= ##Inf (/ 1.0 0.0))"}
|
|
{:suite "numbers / floats & symbolic values" :label "read ##-Inf" :expected "true" :actual "(< ##-Inf 0)"}
|
|
{:suite "numbers / floats & symbolic values" :label "##NaN not= itself" :expected "true" :actual "(not (== ##NaN ##NaN))"}
|
|
{:suite "numbers / floats & symbolic values" :label "float? fractional" :expected "true" :actual "(float? 1.5)"}
|
|
{:suite "numbers / floats & symbolic values" :label "double? fractional" :expected "true" :actual "(double? 0.25)"}
|
|
{:suite "numbers / floats & symbolic values" :label "float? integer" :expected "false" :actual "(float? 3)"}
|
|
{:suite "numbers / floats & symbolic values" :label "float? ##Inf" :expected "true" :actual "(float? ##Inf)"}
|
|
{:suite "numbers / floats & symbolic values" :label "double? ##NaN" :expected "true" :actual "(double? ##NaN)"}
|
|
{:suite "numbers / floats & symbolic values" :label "infinite? ##Inf" :expected "true" :actual "(infinite? ##Inf)"}
|
|
{:suite "numbers / floats & symbolic values" :label "infinite? ##-Inf" :expected "true" :actual "(infinite? ##-Inf)"}
|
|
{:suite "numbers / floats & symbolic values" :label "infinite? finite" :expected "false" :actual "(infinite? 1.5)"}
|
|
{:suite "numbers / floats & symbolic values" :label "NaN? ##NaN" :expected "true" :actual "(NaN? ##NaN)"}
|
|
{:suite "numbers / floats & symbolic values" :label "NaN? number" :expected "false" :actual "(NaN? 1.0)"}
|
|
{:suite "numbers / floats & symbolic values" :label "int? ##Inf false" :expected "false" :actual "(int? ##Inf)"}
|
|
{:suite "numbers / floats & symbolic values" :label "pos-int? ##Inf" :expected "false" :actual "(pos-int? ##Inf)"}
|
|
{:suite "numbers / literal syntax" :label "bigint suffix N" :expected "42N" :actual "42N"}
|
|
{:suite "numbers / literal syntax" :label "bigint zero" :expected "0N" :actual "0N"}
|
|
{:suite "numbers / literal syntax" :label "bigdec suffix M" :expected "1.5M" :actual "1.5M"}
|
|
{:suite "numbers / literal syntax" :label "bigdec int M" :expected "0.0M" :actual "0.0M"}
|
|
{:suite "numbers / literal syntax" :label "ratio -> double" :expected "1/2" :actual "1/2"}
|
|
{:suite "numbers / literal syntax" :label "ratio 3/4" :expected "3/4" :actual "3/4"}
|
|
{:suite "numbers / literal syntax" :label "neg ratio" :expected "-1/2" :actual "-1/2"}
|
|
{:suite "numbers / literal syntax" :label "radix binary" :expected "10" :actual "2r1010"}
|
|
{:suite "numbers / literal syntax" :label "radix hex-ish" :expected "255" :actual "16rFF"}
|
|
{:suite "numbers / literal syntax" :label "radix base36" :expected "35" :actual "36rZ"}
|
|
{:suite "numbers / literal syntax" :label "hex" :expected "255" :actual "0xFF"}
|
|
{:suite "numbers / literal syntax" :label "exponent" :expected "1000.0" :actual "1e3"}
|
|
{:suite "numbers / literal syntax" :label "exponent neg" :expected "0.015" :actual "1.5e-2"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "odd? nil" :expected :throws :actual "(odd? nil)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "odd? fractional" :expected :throws :actual "(odd? 1.5)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "even? inf" :expected :throws :actual "(even? ##Inf)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "zero? nil" :expected :throws :actual "(zero? nil)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "pos? false" :expected :throws :actual "(pos? false)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "neg? keyword" :expected :throws :actual "(neg? :a)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "< nil" :expected :throws :actual "(< nil 1)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "> with nil" :expected :throws :actual "(> 1 nil)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "max non-number" :expected :throws :actual "(max 1 nil)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "quot by zero" :expected :throws :actual "(quot 10 0)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "quot inf" :expected :throws :actual "(quot ##Inf 1)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "< arity-1 any" :expected "true" :actual "(< :anything)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "odd? ok" :expected "true" :actual "(odd? 3)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "< ok" :expected "true" :actual "(< 1 2 3)"}
|
|
{:suite "numbers / strictness (throws like Clojure)" :label "quot ok" :expected "3" :actual "(quot 10 3)"}
|
|
{:suite "numbers / printing of inf & nan" :label "str Infinity" :expected "\"Infinity\"" :actual "(str ##Inf)"}
|
|
{:suite "numbers / printing of inf & nan" :label "str -Infinity" :expected "\"-Infinity\"" :actual "(str ##-Inf)"}
|
|
{:suite "numbers / printing of inf & nan" :label "str NaN" :expected "\"NaN\"" :actual "(str ##NaN)"}
|
|
{:suite "numbers / printing of inf & nan" :label "pr-str Infinity" :expected "\"##Inf\"" :actual "(pr-str ##Inf)"}
|
|
{:suite "numbers / printing of inf & nan" :label "inf inside coll" :expected "\"[##Inf]\"" :actual "(str [##Inf])"}
|
|
{:suite "numbers / bit-ops & math" :label "bit-and" :expected "4" :actual "(bit-and 12 6)"}
|
|
{:suite "numbers / bit-ops & math" :label "bit-or" :expected "14" :actual "(bit-or 12 6)"}
|
|
{:suite "numbers / bit-ops & math" :label "bit-xor" :expected "10" :actual "(bit-xor 12 6)"}
|
|
{:suite "numbers / bit-ops & math" :label "bit-shift-left" :expected "8" :actual "(bit-shift-left 1 3)"}
|
|
{:suite "numbers / bit-ops & math" :label "bit-shift-right" :expected "2" :actual "(bit-shift-right 8 2)"}
|
|
{:suite "numbers / bit-ops & math" :label "bit-set" :expected "8" :actual "(bit-set 0 3)"}
|
|
{:suite "numbers / bit-ops & math" :label "bit-clear" :expected "13" :actual "(bit-clear 15 1)"}
|
|
{:suite "numbers / bit-ops & math" :label "bit-test true" :expected "true" :actual "(bit-test 4 2)"}
|
|
{:suite "numbers / bit-ops & math" :label "bigint 64-bit" :expected "\"9000000000\"" :actual "(str (bigint 9000000000))"}
|
|
{:suite "numbers / random (invariants — non-deterministic)" :label "rand-int in range" :expected "true" :actual "(let [r (rand-int 5)] (and (integer? r) (>= r 0) (< r 5)))"}
|
|
{:suite "numbers / random (invariants — non-deterministic)" :label "rand-int zero" :expected "0" :actual "(rand-int 1)"}
|
|
{:suite "numbers / random (invariants — non-deterministic)" :label "rand in [0,1)" :expected "true" :actual "(let [r (rand)] (and (>= r 0) (< r 1)))"}
|
|
{:suite "numbers / random (invariants — non-deterministic)" :label "rand n in [0,n)" :expected "true" :actual "(let [r (rand 10)] (and (>= r 0) (< r 10)))"}
|
|
{:suite "numbers / random (invariants — non-deterministic)" :label "rand-nth member" :expected "true" :actual "(contains? #{:a :b :c} (rand-nth [:a :b :c]))"}
|
|
{:suite "numbers / random (invariants — non-deterministic)" :label "rand-nth single" :expected ":x" :actual "(rand-nth [:x])"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-long" :expected "42" :actual "(parse-long \"42\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-long negative" :expected "-7" :actual "(parse-long \"-7\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-long plus" :expected "7" :actual "(parse-long \"+7\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-long float nil" :expected "nil" :actual "(parse-long \"1.5\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-long hex nil" :expected "nil" :actual "(parse-long \"0x10\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-long empty nil" :expected "nil" :actual "(parse-long \"\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-long junk nil" :expected "nil" :actual "(parse-long \"12ab\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-long throws" :expected :throws :actual "(parse-long 42)"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-double" :expected "1.5" :actual "(parse-double \"1.5\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-double int" :expected "4.0" :actual "(parse-double \"4\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-double sci" :expected "1500.0" :actual "(parse-double \"1.5e3\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-double neg" :expected "-0.5" :actual "(parse-double \"-0.5\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-double junk" :expected "nil" :actual "(parse-double \"abc\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-double trail" :expected "nil" :actual "(parse-double \"1.5x\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-double throws" :expected :throws :actual "(parse-double :k)"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-boolean true" :expected "true" :actual "(parse-boolean \"true\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-boolean false" :expected "false" :actual "(parse-boolean \"false\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-boolean case" :expected "nil" :actual "(parse-boolean \"True\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-boolean junk" :expected "nil" :actual "(parse-boolean \"yes\")"}
|
|
{:suite "numbers / parse fns (1.11)" :label "parse-boolean throws" :expected :throws :actual "(parse-boolean true)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "+'" :expected "3" :actual "(+' 1 2)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "-'" :expected "3" :actual "(-' 5 2)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "*'" :expected "12" :actual "(*' 3 4)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "inc'" :expected "6" :actual "(inc' 5)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "dec'" :expected "4" :actual "(dec' 5)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-add" :expected "5" :actual "(unchecked-add 2 3)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-add-int" :expected "5" :actual "(unchecked-add-int 2 3)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-subtract" :expected "3" :actual "(unchecked-subtract 5 2)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-subtract-int" :expected "3" :actual "(unchecked-subtract-int 5 2)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-multiply" :expected "12" :actual "(unchecked-multiply 3 4)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-multiply-int" :expected "12" :actual "(unchecked-multiply-int 3 4)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-negate" :expected "-5" :actual "(unchecked-negate 5)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-negate-int" :expected "-5" :actual "(unchecked-negate-int 5)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-inc" :expected "2" :actual "(unchecked-inc 1)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-inc-int" :expected "2" :actual "(unchecked-inc-int 1)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-dec" :expected "0" :actual "(unchecked-dec 1)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-dec-int" :expected "0" :actual "(unchecked-dec-int 1)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-divide-int" :expected "3" :actual "(unchecked-divide-int 7 2)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-divide-int negative truncates toward zero" :expected "-3" :actual "(unchecked-divide-int -7 2)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-divide-int by zero throws" :expected :throws :actual "(unchecked-divide-int 1 0)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-remainder-int" :expected "1" :actual "(unchecked-remainder-int 7 2)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-remainder-int negative" :expected "-1" :actual "(unchecked-remainder-int -7 2)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-int truncates" :expected "3" :actual "(unchecked-int 3.7)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-int negative" :expected "-3" :actual "(unchecked-int -3.7)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "unchecked-long" :expected "3" :actual "(unchecked-long 3.7)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "int? on integer" :expected "true" :actual "(int? 5)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "int? on double" :expected "false" :actual "(int? 5.5)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "int? on non-number" :expected "false" :actual "(int? \"5\")"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "num passes a number through" :expected "5" :actual "(num 5)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "num on a double" :expected "5.5" :actual "(num 5.5)"}
|
|
{:suite "numbers / promoting & unchecked aliases" :label "num throws on non-number" :expected :throws :actual "(num \"x\")"}
|
|
{:suite "numbers / == numeric equality" :label "== single arg" :expected "true" :actual "(== :a)"}
|
|
{:suite "numbers / == numeric equality" :label "== equal" :expected "true" :actual "(== 2 2)"}
|
|
{:suite "numbers / == numeric equality" :label "== unequal" :expected "false" :actual "(== 2 3)"}
|
|
{:suite "numbers / == numeric equality" :label "== chained" :expected "true" :actual "(== 2 2 2)"}
|
|
{:suite "numbers / == numeric equality" :label "== chained unequal" :expected "false" :actual "(== 2 2 3)"}
|
|
{:suite "numbers / == numeric equality" :label "== int and double" :expected "true" :actual "(== 1 1.0)"}
|
|
{:suite "numbers / == numeric equality" :label "== throws on non-number" :expected :throws :actual "(== 1 :a)"}
|
|
{:suite "numbers / == numeric equality" :label "== throws on two keywords" :expected :throws :actual "(== :a :a)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-and 2" :expected "4" :actual "(bit-and 12 6)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-and 3" :expected "4" :actual "(bit-and 12 6 7)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-and 4" :expected "0" :actual "(bit-and 12 6 7 3)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-or 3" :expected "7" :actual "(bit-or 1 2 4)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-xor 3" :expected "7" :actual "(bit-xor 1 2 4)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-xor folds left" :expected "1" :actual "(bit-xor 5 6 2)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-and-not 2" :expected "8" :actual "(bit-and-not 12 6)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-and-not 3" :expected "8" :actual "(bit-and-not 12 6 3)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-and single arg throws" :expected :throws :actual "(bit-and 5)"}
|
|
{:suite "numbers / variadic bit ops" :label "bit-or keeps binary fast path" :expected "3" :actual "(bit-or 1 2)"}
|
|
{:suite "predicates / nil & boolean" :label "nil? true" :expected "true" :actual "(nil? nil)"}
|
|
{:suite "predicates / nil & boolean" :label "nil? false" :expected "false" :actual "(nil? 0)"}
|
|
{:suite "predicates / nil & boolean" :label "some? true" :expected "true" :actual "(some? 0)"}
|
|
{:suite "predicates / nil & boolean" :label "some? on nil" :expected "false" :actual "(some? nil)"}
|
|
{:suite "predicates / nil & boolean" :label "true?" :expected "true" :actual "(true? true)"}
|
|
{:suite "predicates / nil & boolean" :label "false?" :expected "true" :actual "(false? false)"}
|
|
{:suite "predicates / nil & boolean" :label "boolean? true" :expected "true" :actual "(boolean? false)"}
|
|
{:suite "predicates / nil & boolean" :label "not nil" :expected "true" :actual "(not nil)"}
|
|
{:suite "predicates / nil & boolean" :label "not 0 is false" :expected "false" :actual "(not 0)"}
|
|
{:suite "predicates / nil & boolean" :label "boolean of nil" :expected "false" :actual "(boolean nil)"}
|
|
{:suite "predicates / nil & boolean" :label "boolean of value" :expected "true" :actual "(boolean 5)"}
|
|
{:suite "predicates / types" :label "string?" :expected "true" :actual "(string? \"x\")"}
|
|
{:suite "predicates / types" :label "number?" :expected "true" :actual "(number? 1)"}
|
|
{:suite "predicates / types" :label "keyword?" :expected "true" :actual "(keyword? :a)"}
|
|
{:suite "predicates / types" :label "symbol?" :expected "true" :actual "(symbol? (quote a))"}
|
|
{:suite "predicates / types" :label "char?" :expected "true" :actual "(char? \\a)"}
|
|
{:suite "predicates / types" :label "fn? on fn" :expected "true" :actual "(fn? inc)"}
|
|
{:suite "predicates / types" :label "ifn? on keyword" :expected "true" :actual "(ifn? :a)"}
|
|
{:suite "predicates / types" :label "vector?" :expected "true" :actual "(vector? [1])"}
|
|
{:suite "predicates / types" :label "list?" :expected "true" :actual "(list? (list 1))"}
|
|
{:suite "predicates / types" :label "map?" :expected "true" :actual "(map? {:a 1})"}
|
|
{:suite "predicates / types" :label "set?" :expected "true" :actual "(set? #{1})"}
|
|
{:suite "predicates / types" :label "coll? vector" :expected "true" :actual "(coll? [1])"}
|
|
{:suite "predicates / types" :label "coll? map" :expected "true" :actual "(coll? {:a 1})"}
|
|
{:suite "predicates / types" :label "coll? on number" :expected "false" :actual "(coll? 1)"}
|
|
{:suite "predicates / types" :label "seq? list" :expected "true" :actual "(seq? (list 1))"}
|
|
{:suite "predicates / types" :label "seq? vector" :expected "false" :actual "(seq? [1])"}
|
|
{:suite "predicates / types" :label "sequential? vector" :expected "true" :actual "(sequential? [1])"}
|
|
{:suite "predicates / types" :label "associative? map" :expected "true" :actual "(associative? {:a 1})"}
|
|
{:suite "predicates / types" :label "associative? vec" :expected "true" :actual "(associative? [1])"}
|
|
{:suite "predicates / types" :label "associative? list" :expected "false" :actual "(associative? '(1 2))"}
|
|
{:suite "predicates / types" :label "associative? set" :expected "false" :actual "(associative? #{1})"}
|
|
{:suite "predicates / types" :label "reversible? vec" :expected "true" :actual "(reversible? [1 2])"}
|
|
{:suite "predicates / types" :label "reversible? list" :expected "false" :actual "(reversible? '(1 2))"}
|
|
{:suite "predicates / types" :label "reversible? smap" :expected "true" :actual "(reversible? (sorted-map :a 1))"}
|
|
{:suite "predicates / types" :label "reversible? hmap" :expected "false" :actual "(reversible? (hash-map :a 1))"}
|
|
{:suite "predicates / types" :label "indexed? vector" :expected "true" :actual "(indexed? [1])"}
|
|
{:suite "predicates / types" :label "counted? vector" :expected "true" :actual "(counted? [1])"}
|
|
{:suite "predicates / idents" :label "ident? keyword" :expected "true" :actual "(ident? :a)"}
|
|
{:suite "predicates / idents" :label "ident? symbol" :expected "true" :actual "(ident? (quote a))"}
|
|
{:suite "predicates / idents" :label "simple-keyword?" :expected "true" :actual "(simple-keyword? :a)"}
|
|
{:suite "predicates / idents" :label "qualified-keyword?" :expected "true" :actual "(qualified-keyword? :a/b)"}
|
|
{:suite "predicates / idents" :label "simple-symbol?" :expected "true" :actual "(simple-symbol? (quote a))"}
|
|
{:suite "predicates / idents" :label "qualified-symbol?" :expected "true" :actual "(qualified-symbol? (quote a/b))"}
|
|
{:suite "predicates / idents" :label "name of keyword" :expected "\"a\"" :actual "(name :a)"}
|
|
{:suite "predicates / idents" :label "name of qualified" :expected "\"b\"" :actual "(name :a/b)"}
|
|
{:suite "predicates / idents" :label "namespace" :expected "\"a\"" :actual "(namespace :a/b)"}
|
|
{:suite "predicates / idents" :label "namespace simple" :expected "nil" :actual "(namespace :a)"}
|
|
{:suite "predicates / idents" :label "keyword constructor" :expected ":foo" :actual "(keyword \"foo\")"}
|
|
{:suite "predicates / idents" :label "keyword ns + name" :expected ":a/b" :actual "(keyword \"a\" \"b\")"}
|
|
{:suite "predicates / idents" :label "symbol constructor" :expected "(quote x)" :actual "(symbol \"x\")"}
|
|
{:suite "predicates / idents" :label "name of string" :expected "\"s\"" :actual "(name \"s\")"}
|
|
{:suite "predicates / overlay-migrated" :label "not-any? true" :expected "true" :actual "(not-any? even? [1 3 5])"}
|
|
{:suite "predicates / overlay-migrated" :label "not-any? false" :expected "false" :actual "(not-any? even? [1 2 3])"}
|
|
{:suite "predicates / overlay-migrated" :label "not-every? true" :expected "true" :actual "(not-every? even? [2 4 5])"}
|
|
{:suite "predicates / overlay-migrated" :label "not-every? false" :expected "false" :actual "(not-every? even? [2 4 6])"}
|
|
{:suite "predicates / overlay-migrated" :label "ident? number" :expected "false" :actual "(ident? 1)"}
|
|
{:suite "predicates / overlay-migrated" :label "qualified-ident?" :expected "true" :actual "(qualified-ident? :a/b)"}
|
|
{:suite "predicates / overlay-migrated" :label "qualified-ident? no" :expected "false" :actual "(qualified-ident? :a)"}
|
|
{:suite "predicates / overlay-migrated" :label "simple-ident?" :expected "true" :actual "(simple-ident? :a)"}
|
|
{:suite "predicates / overlay-migrated" :label "ratio?" :expected "false" :actual "(ratio? 3)"}
|
|
{:suite "predicates / overlay-migrated" :label "decimal?" :expected "false" :actual "(decimal? 3)"}
|
|
{:suite "predicates / overlay-migrated" :label "class? of value" :expected "false" :actual "(class? \"s\")"}
|
|
{:suite "predicates / overlay-migrated" :label "class? of symbol" :expected "false" :actual "(class? 'java.lang.String)"}
|
|
{:suite "predicates / overlay-migrated" :label "rational? int" :expected "true" :actual "(rational? 3)"}
|
|
{:suite "predicates / overlay-migrated" :label "rational? float" :expected "false" :actual "(rational? 3.5)"}
|
|
{:suite "predicates / overlay-migrated" :label "nat-int? zero" :expected "true" :actual "(nat-int? 0)"}
|
|
{:suite "predicates / overlay-migrated" :label "nat-int? neg" :expected "false" :actual "(nat-int? -1)"}
|
|
{:suite "predicates / overlay-migrated" :label "pos-int?" :expected "true" :actual "(pos-int? 5)"}
|
|
{:suite "predicates / overlay-migrated" :label "neg-int?" :expected "true" :actual "(neg-int? -3)"}
|
|
{:suite "predicates / overlay-migrated" :label "NaN? on nan" :expected "true" :actual "(NaN? (/ 0.0 0.0))"}
|
|
{:suite "predicates / overlay-migrated" :label "NaN? on number" :expected "false" :actual "(NaN? 5)"}
|
|
{:suite "predicates / overlay-migrated" :label "abs negative" :expected "3" :actual "(abs -3)"}
|
|
{:suite "predicates / overlay-migrated" :label "abs positive" :expected "2.5" :actual "(abs 2.5)"}
|
|
{:suite "predicates / overlay-migrated" :label "object?" :expected "false" :actual "(object? 1)"}
|
|
{:suite "predicates / overlay-migrated" :label "undefined?" :expected "false" :actual "(undefined? 1)"}
|
|
{:suite "predicates / overlay-migrated" :label "keyword-identical?" :expected "true" :actual "(keyword-identical? :a :a)"}
|
|
{:suite "predicates / overlay-migrated" :label "keyword-identical? no" :expected "false" :actual "(keyword-identical? :a :b)"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? symbol" :expected "false" :actual "(map? (quote sym))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? char" :expected "false" :actual "(map? \\a)"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? uuid" :expected "false" :actual "(map? (random-uuid))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? literal" :expected "true" :actual "(map? {:a 1})"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? hash-map" :expected "true" :actual "(map? (hash-map :a 1))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? sorted-map" :expected "true" :actual "(map? (sorted-map :a 1))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? record" :expected "true" :actual "(do (defrecord Mr [a]) (map? (->Mr 1)))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? sorted-set" :expected "false" :actual "(map? (sorted-set 1))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "map? vector" :expected "false" :actual "(map? [1])"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? symbol" :expected "false" :actual "(coll? (quote sym))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? char" :expected "false" :actual "(coll? \\a)"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? uuid" :expected "false" :actual "(coll? (random-uuid))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? keyword" :expected "false" :actual "(coll? :k)"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? string" :expected "false" :actual "(coll? \"s\")"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? map literal" :expected "true" :actual "(coll? {:a 1})"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? sorted-map" :expected "true" :actual "(coll? (sorted-map :a 1))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? sorted-set" :expected "true" :actual "(coll? (sorted-set 1))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? record" :expected "true" :actual "(do (defrecord Cr [a]) (coll? (->Cr 1)))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? vector" :expected "true" :actual "(coll? [1])"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? list" :expected "true" :actual "(coll? (list 1))"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? set" :expected "true" :actual "(coll? #{1})"}
|
|
{:suite "predicates / map? & coll? strictness" :label "coll? lazy seq" :expected "true" :actual "(coll? (map inc [1]))"}
|
|
{:suite "predicates / tagged-value" :label "atom? yes" :expected "true" :actual "(atom? (atom 1))"}
|
|
{:suite "predicates / tagged-value" :label "atom? no" :expected "false" :actual "(atom? 1)"}
|
|
{:suite "predicates / tagged-value" :label "volatile? yes" :expected "true" :actual "(volatile? (volatile! 1))"}
|
|
{:suite "predicates / tagged-value" :label "volatile? no" :expected "false" :actual "(volatile? (atom 1))"}
|
|
{:suite "predicates / tagged-value" :label "record? yes" :expected "true" :actual "(do (defrecord Rp [a]) (record? (->Rp 1)))"}
|
|
{:suite "predicates / tagged-value" :label "record? no map" :expected "false" :actual "(record? {:a 1})"}
|
|
{:suite "predicates / tagged-value" :label "record? no nil" :expected "false" :actual "(record? nil)"}
|
|
{:suite "predicates / tagged-value" :label "tagged-literal? yes" :expected "true" :actual "(tagged-literal? (tagged-literal (quote inst) \"2020\"))"}
|
|
{:suite "predicates / tagged-value" :label "tagged-literal? no" :expected "false" :actual "(tagged-literal? 1)"}
|
|
{:suite "predicates / tagged-value" :label "reader-conditional? no" :expected "false" :actual "(reader-conditional? 1)"}
|
|
{:suite "predicates / tagged-value" :label "chunked-seq? always false" :expected "true" :actual "(chunked-seq? (seq [1 2 3]))"}
|
|
{:suite "predicates / equality & identity" :label "= same" :expected "true" :actual "(= 1 1)"}
|
|
{:suite "predicates / equality & identity" :label "= vectors" :expected "true" :actual "(= [1 2] [1 2])"}
|
|
{:suite "predicates / equality & identity" :label "= vector & list" :expected "true" :actual "(= [1 2] (list 1 2))"}
|
|
{:suite "predicates / equality & identity" :label "= maps" :expected "true" :actual "(= {:a 1} {:a 1})"}
|
|
{:suite "predicates / equality & identity" :label "= sets" :expected "true" :actual "(= #{1 2} #{2 1})"}
|
|
{:suite "predicates / equality & identity" :label "= nested" :expected "true" :actual "(= {:a [1 2]} {:a [1 2]})"}
|
|
{:suite "predicates / equality & identity" :label "not= differs" :expected "true" :actual "(not= [1 2] [1 3])"}
|
|
{:suite "predicates / equality & identity" :label "identical? same kw" :expected "true" :actual "(identical? :a :a)"}
|
|
{:suite "predicates / equality & identity" :label "compare strings" :expected "-1" :actual "(compare \"a\" \"b\")"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "seqable? vector" :expected "true" :actual "(seqable? [1])"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "seqable? map" :expected "true" :actual "(seqable? {:a 1})"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "seqable? string" :expected "true" :actual "(seqable? \"s\")"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "seqable? nil" :expected "true" :actual "(seqable? nil)"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "seqable? number" :expected "false" :actual "(seqable? 5)"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "integer? int" :expected "true" :actual "(integer? 5)"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "integer? fraction" :expected "false" :actual "(integer? 5.5)"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "reduced? wrapped" :expected "true" :actual "(reduced? (reduced 1))"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "reduced? plain" :expected "false" :actual "(reduced? 1)"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "deref reduced" :expected "9" :actual "(deref (reduced 9))"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "unreduced wrapped" :expected "9" :actual "(unreduced (reduced 9))"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "unreduced plain" :expected "9" :actual "(unreduced 9)"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "not-empty full" :expected "[1]" :actual "(not-empty [1])"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "not-empty empty" :expected "nil" :actual "(not-empty [])"}
|
|
{:suite "predicates / seqable, reduced & emptiness" :label "not-empty string" :expected "nil" :actual "(not-empty \"\")"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare =" :expected "0" :actual "(compare 1 1)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare <" :expected "-1" :actual "(compare 1 2)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare nil first" :expected "-1" :actual "(compare nil 1)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare nil nil" :expected "0" :actual "(compare nil nil)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare strings" :expected "-1" :actual "(compare \"a\" \"b\")"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare keywords" :expected "-1" :actual "(compare :a :b)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare symbols" :expected "-1" :actual "(compare (quote a) (quote b))"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare bools" :expected "-1" :actual "(compare false true)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare vec length" :expected "-1" :actual "(compare [1 2] [1 2 3])"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare vec elems" :expected "-1" :actual "(compare [1 2] [1 3])"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "compare cross-type throws" :expected :throws :actual "(compare 1 \"a\")"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "sort with compare" :expected "[nil 1 3]" :actual "(sort compare [3 nil 1])"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "type meta override" :expected ":custom" :actual "(type (with-meta [1] {:type :custom}))"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "type of record" :expected "false" :actual "(do (defrecord TyR [a]) (= (symbol (str (type (->TyR 1)))) (type (->TyR 1))))"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "any? value" :expected "true" :actual "(any? 5)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "any? nil" :expected "true" :actual "(any? nil)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "gensym is symbol" :expected "true" :actual "(symbol? (gensym))"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "gensym prefix" :expected "true" :actual "(do (require (quote [clojure.string :as s])) (s/starts-with? (str (gensym \"p_\")) \"p_\"))"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "gensym distinct" :expected "false" :actual "(= (gensym) (gensym))"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "int? Inf false" :expected "false" :actual "(int? ##Inf)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "integer? Inf false" :expected "false" :actual "(integer? ##Inf)"}
|
|
{:suite "predicates / compare, type, any? (stage 3)" :label "integer? NaN false" :expected "false" :actual "(integer? ##NaN)"}
|
|
{:suite "predicates / ifn?" :label "fn" :expected "true" :actual "(ifn? inc)"}
|
|
{:suite "predicates / ifn?" :label "keyword" :expected "true" :actual "(ifn? :k)"}
|
|
{:suite "predicates / ifn?" :label "symbol" :expected "true" :actual "(ifn? (quote s))"}
|
|
{:suite "predicates / ifn?" :label "map" :expected "true" :actual "(ifn? {})"}
|
|
{:suite "predicates / ifn?" :label "sorted map" :expected "true" :actual "(ifn? (sorted-map))"}
|
|
{:suite "predicates / ifn?" :label "set" :expected "true" :actual "(ifn? #{1})"}
|
|
{:suite "predicates / ifn?" :label "vector" :expected "true" :actual "(ifn? [1])"}
|
|
{:suite "predicates / ifn?" :label "var" :expected "true" :actual "(ifn? (var first))"}
|
|
{:suite "predicates / ifn?" :label "list NOT" :expected "false" :actual "(ifn? (list 1 2))"}
|
|
{:suite "predicates / ifn?" :label "lazy NOT" :expected "false" :actual "(ifn? (map inc [1]))"}
|
|
{:suite "predicates / ifn?" :label "string NOT" :expected "false" :actual "(ifn? \"s\")"}
|
|
{:suite "predicates / ifn?" :label "number NOT" :expected "false" :actual "(ifn? 5)"}
|
|
{:suite "predicates / ifn?" :label "nil NOT" :expected "false" :actual "(ifn? nil)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "zero? zero" :expected "true" :actual "(zero? 0)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "zero? nonzero" :expected "false" :actual "(zero? 3)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "zero? throws" :expected :throws :actual "(zero? :a)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "zero? throws on nil" :expected :throws :actual "(zero? nil)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "pos? positive" :expected "true" :actual "(pos? 2)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "pos? zero" :expected "false" :actual "(pos? 0)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "pos? throws" :expected :throws :actual "(pos? \"x\")"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "neg? throws" :expected :throws :actual "(neg? \"x\")"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "every? all pass" :expected "true" :actual "(every? odd? [1 3 5])"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "every? one fails" :expected "false" :actual "(every? odd? [1 2 5])"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "every? vacuous" :expected "true" :actual "(every? odd? [])"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "every? nil coll" :expected "true" :actual "(every? odd? nil)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "every? infinite short-circuit" :expected "false" :actual "(every? pos? (range))"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "char? char" :expected "true" :actual "(char? \\x)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "char? string" :expected "false" :actual "(char? \"x\")"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "char? number" :expected "false" :actual "(char? 97)"}
|
|
{:suite "predicates / numeric guards & every? (overlay moves)" :label "char? nil" :expected "false" :actual "(char? nil)"}
|
|
{:suite "protocols / defprotocol & dispatch" :label "protocol on record" :expected "16" :actual "(do (defprotocol Shape (area [s])) (defrecord Sq [side] Shape (area [_] (* side side))) (area (->Sq 4)))"}
|
|
{:suite "protocols / defprotocol & dispatch" :label "protocol on deftype" :expected "16" :actual "(do (defprotocol Shape (area [s])) (deftype Sq [side] Shape (area [_] (* side side))) (area (->Sq 4)))"}
|
|
{:suite "protocols / defprotocol & dispatch" :label "multiple methods" :expected "[1 2]" :actual "(do (defprotocol P (m [s]) (n [s])) (defrecord R [a b] P (m [_] a) (n [_] b)) [(m (->R 1 2)) (n (->R 1 2))])"}
|
|
{:suite "protocols / defprotocol & dispatch" :label "multiple protocols" :expected "[:a :b]" :actual "(do (defprotocol P1 (p1 [s])) (defprotocol P2 (p2 [s])) (deftype T [] P1 (p1 [_] :a) P2 (p2 [_] :b)) [(p1 (->T)) (p2 (->T))])"}
|
|
{:suite "protocols / defprotocol & dispatch" :label "method args" :expected "7" :actual "(do (defprotocol P (add [s x])) (defrecord R [n] P (add [_ x] (+ n x))) (add (->R 5) 2))"}
|
|
{:suite "protocols / defprotocol & dispatch" :label "extend-type" :expected "10" :actual "(do (defprotocol P (twice [s])) (extend-type Number P (twice [n] (* n 2))) (twice 5))"}
|
|
{:suite "protocols / defprotocol & dispatch" :label "extend-protocol" :expected "[2 4]" :actual "(do (defprotocol P (dbl [s])) (extend-protocol P Number (dbl [n] (* n 2))) [(dbl 1) (dbl 2)])"}
|
|
{:suite "protocols / records" :label "record field access" :expected "1" :actual "(do (defrecord R [a b]) (:a (->R 1 2)))"}
|
|
{:suite "protocols / records" :label "record map access" :expected "2" :actual "(do (defrecord R [a b]) (get (->R 1 2) :b))"}
|
|
{:suite "protocols / records" :label "record equality" :expected "true" :actual "(do (defrecord R [a b]) (= (->R 1 2) (->R 1 2)))"}
|
|
{:suite "protocols / records" :label "record inequality" :expected "false" :actual "(do (defrecord R [a b]) (= (->R 1 2) (->R 3 4)))"}
|
|
{:suite "protocols / records" :label "map-> factory" :expected "1" :actual "(do (defrecord R [a b]) (:a (map->R {:a 1 :b 2})))"}
|
|
{:suite "protocols / records" :label "record? true" :expected "true" :actual "(do (defrecord R [a]) (record? (->R 1)))"}
|
|
{:suite "protocols / records" :label "assoc on record" :expected "9" :actual "(do (defrecord R [a]) (:a (assoc (->R 1) :a 9)))"}
|
|
{:suite "protocols / reify & satisfies" :label "reify dispatch" :expected "42" :actual "(do (defprotocol P (m [_])) (m (reify P (m [_] 42))))"}
|
|
{:suite "protocols / reify & satisfies" :label "reify multi-method" :expected "[1 2]" :actual "(do (defprotocol P (a [_]) (b [_])) (let [r (reify P (a [_] 1) (b [_] 2))] [(a r) (b r)]))"}
|
|
{:suite "protocols / reify & satisfies" :label "satisfies? true" :expected "true" :actual "(do (defprotocol P (m [_])) (defrecord R [] P (m [_] 1)) (satisfies? P (->R)))"}
|
|
{:suite "protocols / reify & satisfies" :label "satisfies? false" :expected "false" :actual "(do (defprotocol P (m [_])) (defrecord R []) (satisfies? P (->R)))"}
|
|
{:suite "protocols / reify & satisfies" :label "satisfies? reify" :expected "true" :actual "(do (defprotocol P (m [_])) (satisfies? P (reify P (m [_] 1))))"}
|
|
{:suite "protocols / reify & satisfies" :label "satisfies? reify multi-protocol" :expected "[true true]" :actual "(do (defprotocol P (m [_])) (defprotocol Q (n [_])) (let [r (reify P (m [_] 1) Q (n [_] 2))] [(satisfies? P r) (satisfies? Q r)]))"}
|
|
{:suite "protocols / reify & satisfies" :label "satisfies? reify other proto" :expected "false" :actual "(do (defprotocol P (m [_])) (defprotocol Q (n [_])) (satisfies? Q (reify P (m [_] 1))))"}
|
|
{:suite "protocols / reify & satisfies" :label "instance? record" :expected "true" :actual "(do (defrecord R [a]) (instance? R (->R 1)))"}
|
|
{:suite "protocols / reify & satisfies" :label "dot constructor" :expected "5" :actual "(do (deftype P [n]) (.-n (P. 5)))"}
|
|
{:suite "protocols / reify & satisfies" :label "dot ctor + method" :expected "5" :actual "(do (defprotocol G (val-of [_])) (deftype P [n] G (val-of [_] n)) (val-of (P. 5)))"}
|
|
{:suite "protocols / defprotocol options" :label "docstring + option + method" :expected ":hi" :actual "(do (defprotocol Pdoc \"docs\" :extend-via-metadata true (greet [x])) (extend-protocol Pdoc String (greet [s] :hi)) (greet \"x\"))"}
|
|
{:suite "protocols / defprotocol options" :label "option only" :expected "3" :actual "(do (defprotocol Popt :extend-via-metadata true (plus2 [x])) (extend-protocol Popt Long (plus2 [n] (+ n 2))) (plus2 1))"}
|
|
{:suite "reader / anonymous fn #()" :label "no args" :expected "3" :actual "(#(+ 1 2))"}
|
|
{:suite "reader / anonymous fn #()" :label "one arg %" :expected "6" :actual "(#(* % 2) 3)"}
|
|
{:suite "reader / anonymous fn #()" :label "positional %1 %2" :expected "[1 2]" :actual "(#(do [%1 %2]) 1 2)"}
|
|
{:suite "reader / anonymous fn #()" :label "rest %&" :expected "[1 2 3]" :actual "(#(do %&) 1 2 3)"}
|
|
{:suite "reader / anonymous fn #()" :label "fixed + rest" :expected "[2 3]" :actual "(#(do % %&) 1 2 3)"}
|
|
{:suite "reader / anonymous fn #()" :label "%2 + rest" :expected "[3]" :actual "(#(do %2 %&) 1 2 3)"}
|
|
{:suite "reader / anonymous fn #()" :label "%2 only (placeholder p1)" :expected "20" :actual "(#(* %2 2) 1 10)"}
|
|
{:suite "reader / anonymous fn #()" :label "% and %1 same" :expected "10" :actual "(#(+ % %1) 5)"}
|
|
{:suite "reader / var-quote #'" :label "var-quote = var" :expected "true" :actual "(= (var str) #'str)"}
|
|
{:suite "reader / var-quote #'" :label "is a var" :expected "true" :actual "(var? #'str)"}
|
|
{:suite "reader / var-quote #'" :label "deref var-quote" :expected "5" :actual "(do (def w 5) (deref #'w))"}
|
|
{:suite "reader / metadata ^" :label "meta on map" :expected "true" :actual "(:foo (meta ^:foo {}))"}
|
|
{:suite "reader / metadata ^" :label "meta on vector" :expected "true" :actual "(:foo (meta ^:foo [1 2]))"}
|
|
{:suite "reader / metadata ^" :label "meta on set" :expected "true" :actual "(:foo (meta ^:foo #{}))"}
|
|
{:suite "reader / metadata ^" :label "meta map form" :expected "1" :actual "(:a (meta ^{:a 1} {}))"}
|
|
{:suite "reader / metadata ^" :label "meta on quoted sym" :expected "true" :actual "(:foo (meta (quote ^:foo bar)))"}
|
|
{:suite "reader / metadata ^" :label "with-meta map" :expected "true" :actual "(:k (meta (with-meta {} {:k true})))"}
|
|
{:suite "reader / metadata ^" :label "with-meta vector" :expected "true" :actual "(:k (meta (with-meta [] {:k true})))"}
|
|
{:suite "reader / metadata ^" :label "non-metadatable num" :expected "nil" :actual "(meta 100)"}
|
|
{:suite "reader / metadata ^" :label "non-metadatable str" :expected "nil" :actual "(meta \"\")"}
|
|
{:suite "reader / metadata ^" :label "non-metadatable bool" :expected "nil" :actual "(meta true)"}
|
|
{:suite "reader / syntax-quote" :label "plain literal" :expected "[1 2 3]" :actual "`[1 2 3]"}
|
|
{:suite "reader / syntax-quote" :label "gensym distinct" :expected "true" :actual "(not= `meow# `meow#)"}
|
|
{:suite "reader / syntax-quote" :label "gensym stable" :expected "true" :actual "(let [s `[meow# meow#]] (= (first s) (second s)))"}
|
|
{:suite "reader / syntax-quote" :label "qualifies unresolved" :expected "(quote user/foo)" :actual "`foo"}
|
|
{:suite "reader / syntax-quote" :label "qualifies core sym" :expected "(quote clojure.core/str)" :actual "`str"}
|
|
{:suite "reader / syntax-quote" :label "unquote value" :expected "[1 2 3]" :actual "(let [a [1 2 3]] `~a)"}
|
|
{:suite "reader / syntax-quote" :label "unquote in call" :expected "(quote (clojure.core/str [1 2 3]))" :actual "(let [a [1 2 3]] `(str ~a))"}
|
|
{:suite "reader / syntax-quote" :label "splice empty" :expected "(quote (clojure.core/str))" :actual "(let [e []] `(str ~@e))"}
|
|
{:suite "reader / syntax-quote" :label "splice values" :expected "(quote (clojure.core/str 1 2 3))" :actual "(let [a [1 2 3]] `(str ~@a))"}
|
|
{:suite "reader / syntax-quote" :label "splice in vector" :expected "[1 2 3 0 1 2 3]" :actual "(let [b [0] a [1 2 3] e []] `[~@e ~@a ~@b ~@a ~@e])"}
|
|
{:suite "reader / syntax-quote" :label "splice in set" :expected "#{0 1 3 2}" :actual "(let [b [0] a [1 2 3] e []] `#{~@e ~@a ~@b})"}
|
|
{:suite "reader / syntax-quote" :label "unquote in set" :expected "#{9 5}" :actual "(let [x 5] `#{~x 9})"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "discard simple" :expected "2" :actual "(do #_1 2)"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "discard in vector" :expected "[1 3]" :actual "[1 #_2 3]"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "discard stacks" :expected "3" :actual "(do #_ #_ 1 2 3)"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "##Inf" :expected "true" :actual "(= ##Inf (/ 1.0 0.0))"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "##-Inf" :expected "true" :actual "(= ##-Inf (/ -1.0 0.0))"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "##NaN not self-equal" :expected "false" :actual "(= ##NaN ##NaN)"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "##NaN is NaN?" :expected "true" :actual "(NaN? ##NaN)"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "conditional :default reachable" :expected "2" :actual "#?(:no-such-dialect 1 :default 2)"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "var-quote qualified" :expected "true" :actual "(= (var clojure.core/str) #'clojure.core/str)"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "gensym stable in template" :expected "true" :actual "(let [syms `[meow# meow#]] (= (first syms) (second syms)))"}
|
|
{:suite "reader / discard, symbolic values, conditionals (spec 2.3)" :label "gensym fresh across templates" :expected "false" :actual "(= `meow# `meow#)"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "string once" :expected "true" :actual "(= \"meow\" `\"meow\")"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "string nested" :expected "true" :actual "(= \"meow\" ``\"meow\")"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "string triple" :expected "true" :actual "(= \"meow\" ```\"meow\")"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "number nested" :expected "true" :actual "(= 42 ``42)"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "keyword nested" :expected "true" :actual "(= :k ``:k)"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "nil nested" :expected "false" :actual "(nil? ``nil)"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "char nested" :expected "true" :actual "(= \\a ``\\a)"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "bool nested" :expected "false" :actual "(= true ``true)"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "symbol still qualifies" :expected "true" :actual "(= (quote clojure.core/map) `map)"}
|
|
{:suite "reader / syntax-quote literal collapse (spec 2.4 S25)" :label "vector still templates" :expected "true" :actual "(= [1 2] `[1 ~(inc 1)])"}
|
|
{:suite "reader / scalar literals" :label "integer" :expected "42" :actual "42"}
|
|
{:suite "reader / scalar literals" :label "negative" :expected "-7" :actual "-7"}
|
|
{:suite "reader / scalar literals" :label "float" :expected "1.5" :actual "1.5"}
|
|
{:suite "reader / scalar literals" :label "string" :expected "\"hi\"" :actual "\"hi\""}
|
|
{:suite "reader / scalar literals" :label "boolean true" :expected "true" :actual "true"}
|
|
{:suite "reader / scalar literals" :label "nil" :expected "nil" :actual "nil"}
|
|
{:suite "reader / scalar literals" :label "keyword" :expected ":a" :actual ":a"}
|
|
{:suite "reader / scalar literals" :label "namespaced keyword" :expected "true" :actual "(= :a/b :a/b)"}
|
|
{:suite "reader / scalar literals" :label "char" :expected "\\a" :actual "\\a"}
|
|
{:suite "reader / scalar literals" :label "char newline" :expected "true" :actual "(= \\newline (first \"\\n\"))"}
|
|
{:suite "reader / scalar literals" :label "char open-brace" :expected "123" :actual "(int \\{)"}
|
|
{:suite "reader / scalar literals" :label "char open-paren" :expected "40" :actual "(int \\()"}
|
|
{:suite "reader / scalar literals" :label "char comma" :expected "44" :actual "(int \\,)"}
|
|
{:suite "reader / scalar literals" :label "char percent" :expected "37" :actual "(int \\%)"}
|
|
{:suite "reader / scalar literals" :label "char unicode" :expected "65" :actual "(int \\u0041)"}
|
|
{:suite "reader / scalar literals" :label "hex literal" :expected "255" :actual "0xff"}
|
|
{:suite "reader / scalar literals" :label "hex uppercase" :expected "31" :actual "0X1F"}
|
|
{:suite "reader / scalar literals" :label "bigint suffix N" :expected "42N" :actual "42N"}
|
|
{:suite "reader / scalar literals" :label "bigdec suffix M" :expected "1.5M" :actual "1.5M"}
|
|
{:suite "reader / scalar literals" :label "ratio -> double" :expected "3/4" :actual "3/4"}
|
|
{:suite "reader / scalar literals" :label "radix integer" :expected "255" :actual "16rFF"}
|
|
{:suite "reader / scalar literals" :label "exponent" :expected "1500.0" :actual "1.5e3"}
|
|
{:suite "reader / scalar literals" :label "symbolic Infinity" :expected "true" :actual "(infinite? ##Inf)"}
|
|
{:suite "reader / scalar literals" :label "symbolic NaN" :expected "true" :actual "(NaN? ##NaN)"}
|
|
{:suite "reader / scalar literals" :label "symbol via quote" :expected "'foo" :actual "'foo"}
|
|
{:suite "reader / collection literals" :label "vector" :expected "[1 2 3]" :actual "[1 2 3]"}
|
|
{:suite "reader / collection literals" :label "list quoted" :expected "[1 2 3]" :actual "'(1 2 3)"}
|
|
{:suite "reader / collection literals" :label "map" :expected "{:a 1}" :actual "{:a 1}"}
|
|
{:suite "reader / collection literals" :label "set" :expected "#{1 3 2}" :actual "#{1 2 3}"}
|
|
{:suite "reader / collection literals" :label "nested" :expected "{:a [1 {:b 2}]}" :actual "{:a [1 {:b 2}]}"}
|
|
{:suite "reader / collection literals" :label "empty vector" :expected "[]" :actual "[]"}
|
|
{:suite "reader / collection literals" :label "empty map" :expected "{}" :actual "{}"}
|
|
{:suite "reader / collection literals" :label "empty set" :expected "#{}" :actual "#{}"}
|
|
{:suite "reader / dispatch & sugar" :label "anon fn #()" :expected "3" :actual "(#(+ %1 %2) 1 2)"}
|
|
{:suite "reader / dispatch & sugar" :label "anon fn single %" :expected "2" :actual "(#(inc %) 1)"}
|
|
{:suite "reader / dispatch & sugar" :label "anon fn %&" :expected "[2 3]" :actual "(#(vec %&) 2 3)"}
|
|
{:suite "reader / dispatch & sugar" :label "discard #_" :expected "[1 3]" :actual "[1 #_2 3]"}
|
|
{:suite "reader / dispatch & sugar" :label "regex literal" :expected "true" :actual "(= \"abc\" (re-find #\"abc\" \"xabcx\"))"}
|
|
{:suite "reader / dispatch & sugar" :label "reader conditional" :expected "1" :actual "#?(:clj 1 :cljs 2 :default 3)"}
|
|
{:suite "reader / dispatch & sugar" :label "reader cond :jolt" :expected "1" :actual "#?(:clj 1 :jolt 4 :default 3)"}
|
|
{:suite "reader / dispatch & sugar" :label "reader cond clause order" :expected "5" :actual "#?(:default 5 :jolt 6)"}
|
|
{:suite "reader / dispatch & sugar" :label "reader cond no match" :expected "[1]" :actual "[#?(:clj 1 :cljs 2)]"}
|
|
{:suite "reader / dispatch & sugar" :label "reader cond splice" :expected "[]" :actual "[#?@(:jolt [1 2 3] :cljs [4 5])]"}
|
|
{:suite "reader / dispatch & sugar" :label "reader cond splice no match" :expected "[1 2 3]" :actual "[#?@(:clj [1 2 3] :cljs [4 5])]"}
|
|
{:suite "reader / dispatch & sugar" :label "inst literal reads" :expected "true" :actual "(some? #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "reader / dispatch & sugar" :label "uuid literal" :expected "\"550e8400-e29b-41d4-a716-446655440000\"" :actual "(str #uuid \"550e8400-e29b-41d4-a716-446655440000\")"}
|
|
{:suite "reader / dispatch & sugar" :label "tagged literal var" :expected "true" :actual "(var? #'+)"}
|
|
{:suite "reader / dispatch & sugar" :label "deref sugar" :expected "5" :actual "(let [a (atom 5)] @a)"}
|
|
{:suite "reader / dispatch & sugar" :label "meta sugar" :expected "{:t 1}" :actual "(meta ^{:t 1} [])"}
|
|
{:suite "reader / comments inside maps" :label "comment in value slot" :expected "{:a 1}" :actual "{:a ; note\n 1}"}
|
|
{:suite "reader / comments inside maps" :label "comment before key" :expected "{:a 1}" :actual "{; lead\n :a 1}"}
|
|
{:suite "reader / comments inside maps" :label "comment between entries" :expected "{:a 1, :b 2}" :actual "{:a 1 ; mid\n :b 2}"}
|
|
{:suite "reader / comments inside maps" :label "discard in value slot" :expected "{:a 1}" :actual "{:a #_9 1}"}
|
|
{:suite "reader / comments inside maps" :label "comment with parens" :expected "{:a {:b 1}}" :actual "{:a ; dev (REPL, etc)\n {:b 1}}"}
|
|
{:suite "reader / comments inside maps" :label "nested with comments" :expected "{:x {:y 2}}" :actual "{:x ; outer\n {:y ; inner\n 2}}"}
|
|
{:suite "regex / literals & predicate" :label "regex? literal" :expected "true" :actual "(regex? #\"\\d+\")"}
|
|
{:suite "regex / literals & predicate" :label "regex? non-regex" :expected "false" :actual "(regex? \"\\d+\")"}
|
|
{:suite "regex / literals & predicate" :label "escaped digits" :expected "\"42\"" :actual "(re-find #\"\\d+\" \"x42y\")"}
|
|
{:suite "regex / literals & predicate" :label "escaped ws/non-ws" :expected "\"x a\"" :actual "(re-find #\"\\S\\s\\S\" \"x a b y\")"}
|
|
{:suite "regex / re-find" :label "match" :expected "\"123\"" :actual "(re-find #\"\\d+\" \"abc123def\")"}
|
|
{:suite "regex / re-find" :label "no match nil" :expected "nil" :actual "(re-find #\"\\d+\" \"abc\")"}
|
|
{:suite "regex / re-find" :label "with groups" :expected "[\"a1\" \"a\" \"1\"]" :actual "(re-find #\"([a-z])(\\d)\" \"--a1--\")"}
|
|
{:suite "regex / re-find" :label "first match only" :expected "\"1\"" :actual "(re-find #\"\\d\" \"1 2 3\")"}
|
|
{:suite "regex / re-matches" :label "full match" :expected "\"123\"" :actual "(re-matches #\"\\d+\" \"123\")"}
|
|
{:suite "regex / re-matches" :label "partial = nil" :expected "nil" :actual "(re-matches #\"\\d+\" \"123abc\")"}
|
|
{:suite "regex / re-matches" :label "groups" :expected "[\"12\" \"1\" \"2\"]" :actual "(re-matches #\"(\\d)(\\d)\" \"12\")"}
|
|
{:suite "regex / re-matches" :label "no match nil" :expected "nil" :actual "(re-matches #\"x+\" \"yyy\")"}
|
|
{:suite "regex / re-seq" :label "all matches" :expected "[\"1\" \"22\" \"333\"]" :actual "(re-seq #\"\\d+\" \"a1b22c333\")"}
|
|
{:suite "regex / re-seq" :label "empty when none" :expected "nil" :actual "(seq (re-seq #\"z\" \"abc\"))"}
|
|
{:suite "regex / re-seq" :label "words" :expected "[\"foo\" \"bar\"]" :actual "(re-seq #\"\\w+\" \"foo bar\")"}
|
|
{:suite "regex / re-pattern & string ops" :label "re-pattern build" :expected "\"hi\"" :actual "(re-find (re-pattern \"\\\\w+\") \"hi!\")"}
|
|
{:suite "regex / re-pattern & string ops" :label "re-pattern is regex?" :expected "true" :actual "(regex? (re-pattern \"a\"))"}
|
|
{:suite "regex / re-pattern & string ops" :label "split on regex" :expected "[\"a\" \"b\" \"c\"]" :actual "(do (require '[clojure.string :as s]) (s/split \"a1b2c\" #\"\\d\"))"}
|
|
{:suite "regex / re-pattern & string ops" :label "replace regex" :expected "\"X-X\"" :actual "(do (require '[clojure.string :as s]) (s/replace \"a-b\" #\"[a-z]\" \"X\"))"}
|
|
{:suite "regex / re-pattern & string ops" :label "replace $1" :expected "\"[a][b]\"" :actual "(do (require '[clojure.string :as s]) (s/replace \"ab\" #\"([a-z])\" \"[$1]\"))"}
|
|
{:suite "regex / \\p property classes" :label "p{L} ascii" :expected "\"hello\"" :actual "(re-matches #\"^\\p{L}+$\" \"hello\")"}
|
|
{:suite "regex / \\p property classes" :label "p{L} utf-8" :expected "true" :actual "(boolean (re-matches #\"^\\p{L}+$\" \"héllo\"))"}
|
|
{:suite "regex / \\p property classes" :label "p{L} rejects digits" :expected "false" :actual "(boolean (re-matches #\"^\\p{L}+$\" \"ab1\"))"}
|
|
{:suite "regex / \\p property classes" :label "p{N}" :expected "[\"12\" \"345\"]" :actual "(re-seq #\"\\p{N}+\" \"a12b345\")"}
|
|
{:suite "regex / \\p property classes" :label "P{N} negation" :expected "\"abc\"" :actual "(re-matches #\"^\\P{N}+$\" \"abc\")"}
|
|
{:suite "regex / \\p property classes" :label "inside class" :expected "\"a-1_b\"" :actual "(re-matches #\"^[\\p{N}\\p{L}_-]+$\" \"a-1_b\")"}
|
|
{:suite "regex / \\p property classes" :label "p{Lu}/p{Ll}" :expected "\"aB\"" :actual "(re-matches #\"^\\p{Ll}\\p{Lu}$\" \"aB\")"}
|
|
{:suite "regex / \\p property classes" :label "p{Z} space" :expected "\" \"" :actual "(re-matches #\"(?u)^[\\s\\p{Z}]+$\" \" \")"}
|
|
{:suite "regex / \\p property classes" :label "p{Ps}/p{Pe}" :expected "\"(x)\"" :actual "(re-matches #\"^\\p{Ps}x\\p{Pe}$\" \"(x)\")"}
|
|
{:suite "regex / \\p property classes" :label "(?u) accepted" :expected "\"hi\"" :actual "(re-matches #\"(?u)^hi$\" \"hi\")"}
|
|
{:suite "regex / \\p property classes" :label "unknown class throws" :expected :throws :actual "(re-pattern \"\\p{Greek}\")"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label "Pattern/compile is a regex" :expected "true" :actual "(regex? (Pattern/compile \"a.c\"))"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label "compiled .split" :expected "[\"a\" \"b\" \"c\"]" :actual "(.split (Pattern/compile \",\") \"a,b,c\")"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label "str/replace w/ Pattern" :expected "\"ab\"" :actual "(do (require '[clojure.string :as s]) (s/replace \"a1b2\" (Pattern/compile \"[0-9]\") \"\"))"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label "Pattern/MULTILINE ^" :expected "true" :actual "(boolean (re-find (Pattern/compile \"^x\" Pattern/MULTILINE) \"y\\nx\"))"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label "Pattern/quote literal" :expected "true" :actual "(boolean (re-find (re-pattern (Pattern/quote \"a.c\")) \"za.cy\"))"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label "Pattern/quote not meta" :expected "false" :actual "(boolean (re-find (re-pattern (Pattern/quote \"a.c\")) \"zabcy\"))"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label ".matches whole string" :expected "true" :actual "(.matches \"abc\" \"a.c\")"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label ".matches partial -> false" :expected "false" :actual "(.matches \"abcd\" \"a.c\")"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label ".replaceAll regex" :expected "\"a-b-c\"" :actual "(.replaceAll \"a_b_c\" \"_\" \"-\")"}
|
|
{:suite "regex / Pattern statics & String regex methods" :label ".replaceFirst regex" :expected "\"a-b_c\"" :actual "(.replaceFirst \"a_b_c\" \"_\" \"-\")"}
|
|
{:suite "regex / bounded quantifiers" :label "exact {n}" :expected "\"aaa\"" :actual "(re-matches #\"a{3}\" \"aaa\")"}
|
|
{:suite "regex / bounded quantifiers" :label "range {n,m} max" :expected "\"aaaa\"" :actual "(re-find #\"a{2,4}\" \"aaaaa\")"}
|
|
{:suite "regex / bounded quantifiers" :label "zero lower {0,n}" :expected "\"aa\"" :actual "(re-find #\"a{0,3}\" \"aa\")"}
|
|
{:suite "regex / bounded quantifiers" :label "{n,} unbounded" :expected "\"aaaa\"" :actual "(re-find #\"a{2,}\" \"aaaa\")"}
|
|
{:suite "regex / bounded quantifiers" :label "nested bounds compile" :expected "true" :actual "(boolean (re-matches #\"[a-z](?:[a-z]{0,61}[a-z])?(?:-[a-z]{0,61}[a-z])*\" \"abc-def\"))"}
|
|
{:suite "regex / backreferences" :label "repeated char" :expected "true" :actual "(boolean (re-find #\"(.)\\1\" \"abba\"))"}
|
|
{:suite "regex / backreferences" :label "no repeat = nil" :expected "nil" :actual "(re-find #\"(.)\\1\" \"abc\")"}
|
|
{:suite "regex / backreferences" :label "thematic-break run" :expected "true" :actual "(boolean (re-matches #\"([-*_])\\1\\1\" \"---\"))"}
|
|
{:suite "regex / backreferences" :label "mismatched run" :expected "nil" :actual "(re-matches #\"([-*_])\\1\\1\" \"-*_\")"}
|
|
{:suite "regex / backreferences" :label "repeated word" :expected "[\"the the\" \"the\"]" :actual "(re-find #\"(\\w+) \\1\" \"say the the word\")"}
|
|
{:suite "regex / backreferences" :label "group still captures" :expected "[\"x=x\" \"x\"]" :actual "(re-matches #\"(\\w+)=\\1\" \"x=x\")"}
|
|
{:suite "regex / backreferences" :label "html tag pair" :expected "true" :actual "(boolean (re-matches #\"<(\\w+)>.*</\\1>\" \"<b>hi</b>\"))"}
|
|
{:suite "seq / access" :label "first of vector" :expected "1" :actual "(first [1 2 3])"}
|
|
{:suite "seq / access" :label "first of list" :expected "1" :actual "(first (list 1 2 3))"}
|
|
{:suite "seq / access" :label "first of empty is nil" :expected "nil" :actual "(first [])"}
|
|
{:suite "seq / access" :label "first of nil is nil" :expected "nil" :actual "(first nil)"}
|
|
{:suite "seq / access" :label "second" :expected "2" :actual "(second [1 2 3])"}
|
|
{:suite "seq / access" :label "last" :expected "3" :actual "(last [1 2 3])"}
|
|
{:suite "seq / access" :label "rest of vector" :expected "[2 3]" :actual "(rest [1 2 3])"}
|
|
{:suite "seq / access" :label "rest of single" :expected "[]" :actual "(rest [1])"}
|
|
{:suite "seq / access" :label "rest of empty" :expected "[]" :actual "(rest [])"}
|
|
{:suite "seq / access" :label "next of single is nil" :expected "nil" :actual "(next [1])"}
|
|
{:suite "seq / access" :label "next of empty is nil" :expected "nil" :actual "(next [])"}
|
|
{:suite "seq / access" :label "nth" :expected "30" :actual "(nth [10 20 30] 2)"}
|
|
{:suite "seq / access" :label "nth with default" :expected "99" :actual "(nth [10] 5 99)"}
|
|
{:suite "seq / access" :label "nth out of range" :expected :throws :actual "(nth [10] 5)"}
|
|
{:suite "seq / access" :label "ffirst" :expected "1" :actual "(ffirst [[1 2] [3 4]])"}
|
|
{:suite "seq / access" :label "fnext" :expected "2" :actual "(fnext [1 2 3])"}
|
|
{:suite "seq / access" :label "nnext" :expected "[3 4]" :actual "(nnext [1 2 3 4])"}
|
|
{:suite "seq / construction" :label "cons onto list" :expected "[0 1 2]" :actual "(cons 0 (list 1 2))"}
|
|
{:suite "seq / construction" :label "cons onto vector" :expected "[0 1 2]" :actual "(cons 0 [1 2])"}
|
|
{:suite "seq / construction" :label "cons onto nil" :expected "[0]" :actual "(cons 0 nil)"}
|
|
{:suite "seq / construction" :label "conj vector appends" :expected "[1 2 3]" :actual "(conj [1 2] 3)"}
|
|
{:suite "seq / construction" :label "conj list prepends" :expected "[0 1 2]" :actual "(conj (list 1 2) 0)"}
|
|
{:suite "seq / construction" :label "conj multiple on vec" :expected "[1 2 3 4]" :actual "(conj [1 2] 3 4)"}
|
|
{:suite "seq / construction" :label "conj multiple on list" :expected "[4 3 1 2]" :actual "(conj (list 1 2) 3 4)"}
|
|
{:suite "seq / construction" :label "seq of empty is nil" :expected "nil" :actual "(seq [])"}
|
|
{:suite "seq / construction" :label "seq of nil is nil" :expected "nil" :actual "(seq nil)"}
|
|
{:suite "seq / construction" :label "seq of string" :expected "[\\a \\b]" :actual "(seq \"ab\")"}
|
|
{:suite "seq / construction" :label "empty?" :expected "true" :actual "(empty? [])"}
|
|
{:suite "seq / construction" :label "not empty?" :expected "false" :actual "(empty? [1])"}
|
|
{:suite "seq / construction" :label "count" :expected "3" :actual "(count [1 2 3])"}
|
|
{:suite "seq / construction" :label "count of nil" :expected "0" :actual "(count nil)"}
|
|
{:suite "seq / construction" :label "count of string" :expected "3" :actual "(count \"abc\")"}
|
|
{:suite "seq / map filter reduce" :label "map" :expected "[2 3 4]" :actual "(map inc [1 2 3])"}
|
|
{:suite "seq / map filter reduce" :label "map two colls" :expected "[5 7 9]" :actual "(map + [1 2 3] [4 5 6])"}
|
|
{:suite "seq / map filter reduce" :label "map stops at shortest" :expected "[5 7]" :actual "(map + [1 2] [4 5 6])"}
|
|
{:suite "seq / map filter reduce" :label "map keeps nil elements" :expected "[[1 :a] [nil :b] [3 nil]]" :actual "(map vector [1 nil 3] [:a :b nil])"}
|
|
{:suite "seq / map filter reduce" :label "map 3 colls" :expected "[12 15 18]" :actual "(map + [1 2 3] [4 5 6] [7 8 9])"}
|
|
{:suite "seq / map filter reduce" :label "map 3 colls shortest" :expected "[12 15]" :actual "(map + [1 2] [4 5 6] [7 8 9])"}
|
|
{:suite "seq / map filter reduce" :label "map 4 colls" :expected "[16 20]" :actual "(map + [1 2] [3 4] [5 6] [7 8])"}
|
|
{:suite "seq / map filter reduce" :label "map 3 colls nils" :expected "[[1 :a 10] [nil :b 20] [3 nil 30]]" :actual "(map vector [1 nil 3] [:a :b nil] [10 20 30])"}
|
|
{:suite "seq / map filter reduce" :label "map empty coll" :expected "[]" :actual "(map + [] [1 2 3] [4 5 6])"}
|
|
{:suite "seq / map filter reduce" :label "map lazy+concrete" :expected "[11 22 33]" :actual "(map + (map identity [1 2 3]) [10 20 30])"}
|
|
{:suite "seq / map filter reduce" :label "map-indexed" :expected "[[0 :a] [1 :b]]" :actual "(map-indexed vector [:a :b])"}
|
|
{:suite "seq / map filter reduce" :label "mapv" :expected "[2 3 4]" :actual "(mapv inc [1 2 3])"}
|
|
{:suite "seq / map filter reduce" :label "filter" :expected "[2 4]" :actual "(filter even? [1 2 3 4])"}
|
|
{:suite "seq / map filter reduce" :label "filterv" :expected "[2 4]" :actual "(filterv even? [1 2 3 4])"}
|
|
{:suite "seq / map filter reduce" :label "remove" :expected "[1 3]" :actual "(remove even? [1 2 3 4])"}
|
|
{:suite "seq / map filter reduce" :label "reduce" :expected "10" :actual "(reduce + [1 2 3 4])"}
|
|
{:suite "seq / map filter reduce" :label "reduce with init" :expected "20" :actual "(reduce + 10 [1 2 3 4])"}
|
|
{:suite "seq / map filter reduce" :label "reduce empty with init" :expected "0" :actual "(reduce + 0 [])"}
|
|
{:suite "seq / map filter reduce" :label "reduce single no init" :expected "5" :actual "(reduce + [5])"}
|
|
{:suite "seq / map filter reduce" :label "reduced short-circuits" :expected "3" :actual "(reduce (fn [a x] (if (> a 2) (reduced a) (+ a x))) 0 [1 2 3 4 5])"}
|
|
{:suite "seq / map filter reduce" :label "reduce-kv" :expected "6" :actual "(reduce-kv (fn [a k v] (+ a v)) 0 {:a 1 :b 2 :c 3})"}
|
|
{:suite "seq / map filter reduce" :label "reduce-kv on vector" :expected "[[0 :a] [1 :b]]" :actual "(reduce-kv (fn [a i v] (conj a [i v])) [] [:a :b])"}
|
|
{:suite "seq / map filter reduce" :label "reduce-kv honors reduced" :expected "[:a]" :actual "(reduce-kv (fn [a i v] (if (= i 1) (reduced a) (conj a v))) [] [:a :b :c])"}
|
|
{:suite "seq / map filter reduce" :label "reduce-kv on nil" :expected "0" :actual "(reduce-kv (fn [a k v] (+ a v)) 0 nil)"}
|
|
{:suite "seq / map filter reduce" :label "reductions" :expected "[1 3 6]" :actual "(reductions + [1 2 3])"}
|
|
{:suite "seq / map filter reduce" :label "mapcat" :expected "[1 1 2 2]" :actual "(mapcat (fn [x] [x x]) [1 2])"}
|
|
{:suite "seq / map filter reduce" :label "mapcat two colls" :expected "[1 3 2 4]" :actual "(mapcat vector [1 2] [3 4])"}
|
|
{:suite "seq / map filter reduce" :label "mapcat three colls" :expected "[1 2 3]" :actual "(mapcat vector [1] [2] [3])"}
|
|
{:suite "seq / map filter reduce" :label "mapcat empty coll" :expected "[]" :actual "(mapcat vector [] [1 2] [3 4])"}
|
|
{:suite "seq / map filter reduce" :label "mapcat seqs" :expected "[1 2 3 4]" :actual "(mapcat identity [[1 2] [3 4]])"}
|
|
{:suite "seq / map filter reduce" :label "keep" :expected "[1 3]" :actual "(keep (fn [x] (if (odd? x) x nil)) [1 2 3 4])"}
|
|
{:suite "seq / map filter reduce" :label "some truthy" :expected "true" :actual "(some even? [1 2 3])"}
|
|
{:suite "seq / map filter reduce" :label "some nil" :expected "nil" :actual "(some even? [1 3 5])"}
|
|
{:suite "seq / map filter reduce" :label "every? true" :expected "true" :actual "(every? pos? [1 2 3])"}
|
|
{:suite "seq / map filter reduce" :label "every? false" :expected "false" :actual "(every? pos? [1 -2 3])"}
|
|
{:suite "seq / take drop slice" :label "take" :expected "[1 2 3]" :actual "(take 3 [1 2 3 4 5])"}
|
|
{:suite "seq / take drop slice" :label "take more than size" :expected "[1 2]" :actual "(take 5 [1 2])"}
|
|
{:suite "seq / take drop slice" :label "drop" :expected "[4 5]" :actual "(drop 3 [1 2 3 4 5])"}
|
|
{:suite "seq / take drop slice" :label "take-while" :expected "[1 2]" :actual "(take-while (fn [x] (< x 3)) [1 2 3 1])"}
|
|
{:suite "seq / take drop slice" :label "drop-while" :expected "[3 1]" :actual "(drop-while (fn [x] (< x 3)) [1 2 3 1])"}
|
|
{:suite "seq / take drop slice" :label "take-last" :expected "[4 5]" :actual "(take-last 2 [1 2 3 4 5])"}
|
|
{:suite "seq / take drop slice" :label "drop-last" :expected "[1 2 3]" :actual "(drop-last [1 2 3 4])"}
|
|
{:suite "seq / take drop slice" :label "take-nth" :expected "[1 3 5]" :actual "(take-nth 2 [1 2 3 4 5])"}
|
|
{:suite "seq / take drop slice" :label "partition" :expected "[[1 2] [3 4]]" :actual "(partition 2 [1 2 3 4 5])"}
|
|
{:suite "seq / take drop slice" :label "partition-all" :expected "[[1 2] [3]]" :actual "(partition-all 2 [1 2 3])"}
|
|
{:suite "seq / take drop slice" :label "split-at" :expected "[[1 2] [3 4]]" :actual "(split-at 2 [1 2 3 4])"}
|
|
{:suite "seq / transform" :label "reverse" :expected "[3 2 1]" :actual "(reverse [1 2 3])"}
|
|
{:suite "seq / transform" :label "sort" :expected "[1 2 3]" :actual "(sort [3 1 2])"}
|
|
{:suite "seq / transform" :label "sort with comparator" :expected "[3 2 1]" :actual "(sort > [1 3 2])"}
|
|
{:suite "seq / transform" :label "sort-by" :expected "[[1] [2 2]]" :actual "(sort-by count [[2 2] [1]])"}
|
|
{:suite "seq / transform" :label "distinct" :expected "[1 2 3]" :actual "(distinct [1 1 2 3 3])"}
|
|
{:suite "seq / transform" :label "dedupe" :expected "[1 2 1]" :actual "(dedupe [1 1 2 1])"}
|
|
{:suite "seq / transform" :label "interpose" :expected "[1 0 2 0 3]" :actual "(interpose 0 [1 2 3])"}
|
|
{:suite "seq / transform" :label "interleave" :expected "[1 :a 2 :b]" :actual "(interleave [1 2] [:a :b])"}
|
|
{:suite "seq / transform" :label "flatten" :expected "[1 2 3 4]" :actual "(flatten [1 [2 [3 [4]]]])"}
|
|
{:suite "seq / transform" :label "concat" :expected "[1 2 3 4]" :actual "(concat [1 2] [3 4])"}
|
|
{:suite "seq / transform" :label "into vector" :expected "[1 2 3 4]" :actual "(into [1 2] [3 4])"}
|
|
{:suite "seq / transform" :label "into list" :expected "[3 2 1]" :actual "(into (list) [1 2 3])"}
|
|
{:suite "seq / transform" :label "frequencies" :expected "{1 2, 2 1}" :actual "(frequencies [1 1 2])"}
|
|
{:suite "seq / transform" :label "group-by" :expected "{false [1 3], true [2 4]}" :actual "(group-by even? [1 2 3 4])"}
|
|
{:suite "seq / transform" :label "zipmap" :expected "{:a 1, :b 2}" :actual "(zipmap [:a :b] [1 2])"}
|
|
{:suite "seq / transform" :label "mapcat seqs" :expected "[1 2 3 4]" :actual "(mapcat identity [[1 2] [3 4]])"}
|
|
{:suite "seq / generators" :label "range n" :expected "[0 1 2 3]" :actual "(range 4)"}
|
|
{:suite "seq / generators" :label "range from to" :expected "[2 3 4]" :actual "(range 2 5)"}
|
|
{:suite "seq / generators" :label "range with step" :expected "[0 2 4]" :actual "(range 0 6 2)"}
|
|
{:suite "seq / generators" :label "take repeat" :expected "[:x :x :x]" :actual "(take 3 (repeat :x))"}
|
|
{:suite "seq / generators" :label "repeat n" :expected "[5 5]" :actual "(repeat 2 5)"}
|
|
{:suite "seq / generators" :label "take iterate" :expected "[1 2 4 8]" :actual "(take 4 (iterate (fn [x] (* x 2)) 1))"}
|
|
{:suite "seq / generators" :label "take cycle" :expected "[1 2 1 2 1]" :actual "(take 5 (cycle [1 2]))"}
|
|
{:suite "seq / generators" :label "take repeatedly" :expected "3" :actual "(count (take 3 (repeatedly (fn [] 1))))"}
|
|
{:suite "seq / generators" :label "take-last of range" :expected "[8 9]" :actual "(take-last 2 (range 10))"}
|
|
{:suite "seq / IFn values as functions" :label "map keyword" :expected "[1 2 3]" :actual "(map :a [{:a 1} {:a 2} {:a 3}])"}
|
|
{:suite "seq / IFn values as functions" :label "filter keyword" :expected "[{:ok true}]" :actual "(filter :ok [{:ok true} {:ok false}])"}
|
|
{:suite "seq / IFn values as functions" :label "remove keyword" :expected "[{:ok false}]" :actual "(remove :ok [{:ok true} {:ok false}])"}
|
|
{:suite "seq / IFn values as functions" :label "sort-by keyword" :expected "[{:a 1} {:a 2} {:a 3}]" :actual "(sort-by :a [{:a 3} {:a 1} {:a 2}])"}
|
|
{:suite "seq / IFn values as functions" :label "sort-by key + cmp" :expected "[{:a 3} {:a 2} {:a 1}]" :actual "(sort-by :a > [{:a 3} {:a 1} {:a 2}])"}
|
|
{:suite "seq / IFn values as functions" :label "filter set" :expected "[2 4]" :actual "(filter #{2 4} [1 2 3 4 5])"}
|
|
{:suite "seq / IFn values as functions" :label "remove set" :expected "[1 3 5]" :actual "(remove #{2 4} [1 2 3 4 5])"}
|
|
{:suite "seq / IFn values as functions" :label "group-by keyword" :expected "{1 [{:n 1}], 2 [{:n 2}]}" :actual "(group-by :n [{:n 1} {:n 2}])"}
|
|
{:suite "seq / IFn values as functions" :label "map a map" :expected "[1 nil 2]" :actual "(map {:a 1 :b 2} [:a :z :b])"}
|
|
{:suite "seq / IFn values as functions" :label "take-nth transducer" :expected "[0 2 4 6 8]" :actual "(into [] (take-nth 2) (range 10))"}
|
|
{:suite "seq / IFn values as functions" :label "interpose transducer" :expected "[1 :x 2]" :actual "(into [] (interpose :x) [1 2])"}
|
|
{:suite "seq / conj edge cases" :label "conj no args" :expected "[]" :actual "(conj)"}
|
|
{:suite "seq / conj edge cases" :label "conj nil one" :expected "[3]" :actual "(conj nil 3)"}
|
|
{:suite "seq / conj edge cases" :label "conj nil many" :expected "[2 1]" :actual "(conj nil 1 2)"}
|
|
{:suite "seq / conj edge cases" :label "conj vector" :expected "[1 2 3]" :actual "(conj [1 2] 3)"}
|
|
{:suite "seq / conj edge cases" :label "conj list prepend" :expected "[0 1 2]" :actual "(conj '(1 2) 0)"}
|
|
{:suite "seq / conj edge cases" :label "conj map + map" :expected "{:a 0, :b 1}" :actual "(conj {:a 0} {:b 1})"}
|
|
{:suite "seq / conj edge cases" :label "conj map + pair" :expected "{:a 0, :b 1}" :actual "(conj {:a 0} [:b 1])"}
|
|
{:suite "seq / conj edge cases" :label "conj map merge wins" :expected "{:a 2}" :actual "(conj {:a 0} {:a 1} {:a 2})"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "cons non-seqable num" :expected :throws :actual "(cons 1 42)"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "cons non-seqable kw" :expected :throws :actual "(cons 1 :k)"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "cons onto nil ok" :expected "[1]" :actual "(cons 1 nil)"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "cons onto seq ok" :expected "[0 1 2]" :actual "(cons 0 [1 2])"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "num non-number" :expected :throws :actual "(num \"x\")"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "num ok" :expected "5" :actual "(num 5)"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "realized? on number" :expected :throws :actual "(realized? 1)"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "realized? on nil" :expected :throws :actual "(realized? nil)"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "symbol from nil" :expected :throws :actual "(symbol nil)"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "symbol bad 2-arg" :expected :throws :actual "(symbol :a \"b\")"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "symbol from keyword" :expected "\"x\"" :actual "(name (symbol :x))"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "keyword bad 2-arg" :expected :throws :actual "(keyword \"abc\" nil)"}
|
|
{:suite "seq / strictness (throws like Clojure)" :label "keyword from symbol" :expected "\"x\"" :actual "(name (keyword 'x))"}
|
|
{:suite "seq / accessor strictness" :label "peek vector" :expected "3" :actual "(peek [1 2 3])"}
|
|
{:suite "seq / accessor strictness" :label "peek list" :expected "1" :actual "(peek '(1 2 3))"}
|
|
{:suite "seq / accessor strictness" :label "peek empty vec" :expected "nil" :actual "(peek [])"}
|
|
{:suite "seq / accessor strictness" :label "peek on set" :expected :throws :actual "(peek #{1 2})"}
|
|
{:suite "seq / accessor strictness" :label "peek on number" :expected :throws :actual "(peek 42)"}
|
|
{:suite "seq / accessor strictness" :label "pop empty vec" :expected :throws :actual "(pop [])"}
|
|
{:suite "seq / accessor strictness" :label "pop on number" :expected :throws :actual "(pop 0)"}
|
|
{:suite "seq / accessor strictness" :label "pop vector" :expected "[1 2]" :actual "(pop [1 2 3])"}
|
|
{:suite "seq / accessor strictness" :label "vec on number" :expected :throws :actual "(vec 42)"}
|
|
{:suite "seq / accessor strictness" :label "vec on keyword" :expected :throws :actual "(vec :a)"}
|
|
{:suite "seq / accessor strictness" :label "vec ok" :expected "[1 2]" :actual "(vec '(1 2))"}
|
|
{:suite "seq / accessor strictness" :label "key on nil" :expected :throws :actual "(key nil)"}
|
|
{:suite "seq / accessor strictness" :label "key on map" :expected :throws :actual "(key {})"}
|
|
{:suite "seq / accessor strictness" :label "val on number" :expected :throws :actual "(val 0)"}
|
|
{:suite "seq / accessor strictness" :label "key of entry" :expected ":a" :actual "(key (first {:a 1}))"}
|
|
{:suite "seq / accessor strictness" :label "val of entry" :expected "1" :actual "(val (first {:a 1}))"}
|
|
{:suite "seq / more strictness" :label "first on number" :expected :throws :actual "(first 42)"}
|
|
{:suite "seq / more strictness" :label "first on keyword" :expected :throws :actual "(first :a)"}
|
|
{:suite "seq / more strictness" :label "first ok vec" :expected "1" :actual "(first [1 2])"}
|
|
{:suite "seq / more strictness" :label "first ok nil" :expected "nil" :actual "(first nil)"}
|
|
{:suite "seq / more strictness" :label "rseq vector" :expected "[3 2 1]" :actual "(rseq [1 2 3])"}
|
|
{:suite "seq / more strictness" :label "rseq on string" :expected :throws :actual "(rseq \"ab\")"}
|
|
{:suite "seq / more strictness" :label "rseq on map" :expected :throws :actual "(rseq {:a 1})"}
|
|
{:suite "seq / more strictness" :label "rseq on number" :expected :throws :actual "(rseq 0)"}
|
|
{:suite "seq / more strictness" :label "assoc odd args" :expected :throws :actual "(assoc {:a 1} :b)"}
|
|
{:suite "seq / more strictness" :label "assoc on number" :expected :throws :actual "(assoc 5 :a 1)"}
|
|
{:suite "seq / more strictness" :label "assoc on set" :expected :throws :actual "(assoc #{} :a 1)"}
|
|
{:suite "seq / strictness round 3" :label "seq on number" :expected :throws :actual "(seq 1)"}
|
|
{:suite "seq / strictness round 3" :label "seq on fn" :expected :throws :actual "(seq (fn [] 1))"}
|
|
{:suite "seq / strictness round 3" :label "seq vector ok" :expected "[1 2]" :actual "(seq [1 2])"}
|
|
{:suite "seq / strictness round 3" :label "NaN? on nil" :expected :throws :actual "(NaN? nil)"}
|
|
{:suite "seq / strictness round 3" :label "NaN? on number ok" :expected "false" :actual "(NaN? 1.0)"}
|
|
{:suite "seq / strictness round 3" :label "shuffle on number" :expected :throws :actual "(shuffle 1)"}
|
|
{:suite "seq / strictness round 3" :label "shuffle on string" :expected :throws :actual "(shuffle \"abc\")"}
|
|
{:suite "seq / strictness round 3" :label "shuffle vec ok" :expected "3" :actual "(count (shuffle [1 2 3]))"}
|
|
{:suite "seq / strictness round 3" :label "nthrest nil count" :expected :throws :actual "(nthrest [0 1 2] nil)"}
|
|
{:suite "seq / strictness round 3" :label "nthrest negative" :expected "[0 1 2]" :actual "(nthrest [0 1 2] -1)"}
|
|
{:suite "seq / strictness round 3" :label "nthrest nil coll" :expected "nil" :actual "(nthrest nil 0)"}
|
|
{:suite "seq / strictness round 3" :label "nthnext nil count" :expected :throws :actual "(nthnext [0 1 2] nil)"}
|
|
{:suite "seq / strictness round 3" :label "update vec oob" :expected :throws :actual "(update [] 1 identity)"}
|
|
{:suite "seq / strictness round 3" :label "update vec kw key" :expected :throws :actual "(update [1 2 3] :k identity)"}
|
|
{:suite "seq / overlay-migrated fns" :label "nthrest exhausted -> ()" :expected "[]" :actual "(nthrest nil 100)"}
|
|
{:suite "seq / overlay-migrated fns" :label "nthrest vec exhausted" :expected "[]" :actual "(nthrest [1 2 3] 100)"}
|
|
{:suite "seq / overlay-migrated fns" :label "nthrest n<=0 keeps coll" :expected "[1 2 3]" :actual "(nthrest [1 2 3] 0)"}
|
|
{:suite "seq / overlay-migrated fns" :label "nthrest drops n" :expected "[3 4 5]" :actual "(nthrest [1 2 3 4 5] 2)"}
|
|
{:suite "seq / overlay-migrated fns" :label "nthnext exhausted -> nil" :expected "nil" :actual "(nthnext [1 2] 5)"}
|
|
{:suite "seq / overlay-migrated fns" :label "nthnext surprising nil" :expected "nil" :actual "(nthnext nil nil)"}
|
|
{:suite "seq / overlay-migrated fns" :label "nthnext drops n" :expected "[3 4]" :actual "(nthnext [1 2 3 4] 2)"}
|
|
{:suite "seq / overlay-migrated fns" :label "distinct? distinct" :expected "true" :actual "(distinct? 1 2 3)"}
|
|
{:suite "seq / overlay-migrated fns" :label "distinct? dup" :expected "false" :actual "(distinct? 1 2 1)"}
|
|
{:suite "seq / overlay-migrated fns" :label "distinct? equal colls" :expected "false" :actual "(distinct? [1 2] [1 2])"}
|
|
{:suite "seq / overlay-migrated fns" :label "distinct? single" :expected "true" :actual "(distinct? 5)"}
|
|
{:suite "seq / overlay-migrated fns" :label "replace maps elements" :expected "[:a 2 :c 2]" :actual "(replace {1 :a 3 :c} [1 2 3 2])"}
|
|
{:suite "seq / overlay-migrated fns" :label "replace preserves nil val" :expected "[1 nil 3]" :actual "(replace {2 nil} [1 2 3])"}
|
|
{:suite "seq / overlay-migrated fns" :label "take-last" :expected "[3 4]" :actual "(take-last 2 [1 2 3 4])"}
|
|
{:suite "seq / overlay-migrated fns" :label "take-last empty -> nil" :expected "nil" :actual "(take-last 2 [])"}
|
|
{:suite "seq / overlay-migrated fns" :label "take-last n>len" :expected "[1 2]" :actual "(take-last 9 [1 2])"}
|
|
{:suite "seq / overlay-migrated fns" :label "drop-last default 1" :expected "[1 2]" :actual "(drop-last [1 2 3])"}
|
|
{:suite "seq / overlay-migrated fns" :label "drop-last n" :expected "[1 2]" :actual "(drop-last 2 [1 2 3 4])"}
|
|
{:suite "seq / overlay-migrated fns" :label "split-with" :expected "[[2 4] [5 6]]" :actual "(split-with even? [2 4 5 6])"}
|
|
{:suite "seq / overlay-migrated fns" :label "replicate" :expected "[:x :x :x]" :actual "(replicate 3 :x)"}
|
|
{:suite "seq / overlay-migrated fns" :label "bounded-count" :expected "5" :actual "(bounded-count 3 [1 2 3 4 5])"}
|
|
{:suite "seq / overlay-migrated fns" :label "bounded-count uncounted" :expected "3" :actual "(bounded-count 3 (filter odd? (range 100)))"}
|
|
{:suite "seq / overlay-migrated fns" :label "run! side effects" :expected "6" :actual "(let [a (atom 0)] (run! (fn [x] (swap! a + x)) [1 2 3]) @a)"}
|
|
{:suite "seq / overlay-migrated fns" :label "completing wraps rf" :expected "3" :actual "((completing +) 1 2)"}
|
|
{:suite "seq / overlay-migrated fns" :label "comparator <" :expected "[1 2 3]" :actual "(sort (comparator <) [3 1 2])"}
|
|
{:suite "seq / overlay-migrated fns" :label "comparator >" :expected "[3 2 1]" :actual "(sort (comparator >) [3 1 2])"}
|
|
{:suite "seq / overlay-migrated fns" :label "reductions" :expected "[1 3 6 10]" :actual "(reductions + [1 2 3 4])"}
|
|
{:suite "seq / overlay-migrated fns" :label "reductions with init" :expected "[10 11 13 16]" :actual "(reductions + 10 [1 2 3])"}
|
|
{:suite "seq / overlay-migrated fns" :label "reductions empty calls f" :expected "[0]" :actual "(reductions + [])"}
|
|
{:suite "seq / overlay-migrated fns" :label "reductions empty + init" :expected "[5]" :actual "(reductions + 5 [])"}
|
|
{:suite "seq / overlay-migrated fns" :label "tree-seq pre-order" :expected "[[1 [2] 3] 1 [2] 2 3]" :actual "(tree-seq sequential? seq [1 [2] 3])"}
|
|
{:suite "seq / overlay-migrated fns" :label "some found" :expected "true" :actual "(some even? [1 3 4])"}
|
|
{:suite "seq / overlay-migrated fns" :label "some none -> nil" :expected "nil" :actual "(some even? [1 3 5])"}
|
|
{:suite "seq / overlay-migrated fns" :label "some keyword pred" :expected "7" :actual "(some :a [{:b 1} {:a 7}])"}
|
|
{:suite "seq / overlay-migrated fns" :label "some returns value" :expected "4" :actual "(some (fn [x] (when (even? x) x)) [1 3 4 5])"}
|
|
{:suite "seq / overlay-migrated fns" :label "flatten nested" :expected "[1 2 3 4 5]" :actual "(flatten [1 [2 [3 4]] 5])"}
|
|
{:suite "seq / overlay-migrated fns" :label "flatten lists too" :expected "[1 2 3]" :actual "(flatten [1 (list 2 3)])"}
|
|
{:suite "seq / overlay-migrated fns" :label "flatten scalar -> empty" :expected "[]" :actual "(flatten 5)"}
|
|
{:suite "seq / overlay-migrated fns" :label "interleave" :expected "[1 :a 2 :b]" :actual "(interleave [1 2 3] [:a :b])"}
|
|
{:suite "seq / overlay-migrated fns" :label "interleave empty" :expected "[]" :actual "(interleave)"}
|
|
{:suite "seq / overlay-migrated fns" :label "rationalize identity" :expected "5" :actual "(rationalize 5)"}
|
|
{:suite "seq / overlay-migrated fns" :label "dedupe consecutive" :expected "[1 2 3 1]" :actual "(dedupe [1 1 2 2 3 1 1])"}
|
|
{:suite "seq / overlay-migrated fns" :label "dedupe empty" :expected "[]" :actual "(dedupe [])"}
|
|
{:suite "seq / overlay-migrated fns" :label "dedupe no dups" :expected "[1 2 3]" :actual "(dedupe [1 2 3])"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "partitionv" :expected "[[1 2] [3 4]]" :actual "(partitionv 2 [1 2 3 4 5])"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "partitionv elems are vectors" :expected "true" :actual "(every? vector? (partitionv 2 [1 2 3 4]))"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "partitionv step" :expected "[[1 2] [3 4]]" :actual "(partitionv 2 2 [1 2 3 4 5])"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "partitionv pad" :expected "[[1 2] [3 :p]]" :actual "(partitionv 2 2 [:p] [1 2 3])"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "partitionv-all" :expected "[[1 2] [3]]" :actual "(partitionv-all 2 [1 2 3])"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "partitionv-all vectors" :expected "true" :actual "(every? vector? (partitionv-all 2 [1 2 3]))"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "splitv-at" :expected "[[1 2] [3 4]]" :actual "(splitv-at 2 [1 2 3 4])"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "splitv-at first is vector" :expected "true" :actual "(vector? (first (splitv-at 2 [1 2 3])))"}
|
|
{:suite "seq / partitionv & splitv-at (1.11)" :label "splitv-at past end" :expected "[[1 2] []]" :actual "(splitv-at 5 [1 2])"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "rest of vector is a seq" :expected "true" :actual "(seq? (rest [1 2 3]))"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "rest of vector not vector" :expected "false" :actual "(vector? (rest [1 2 3]))"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "rest values" :expected "[2 3]" :actual "(rest [1 2 3])"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "next of vector" :expected "[2 3]" :actual "(next [1 2 3])"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "next exhausts to nil" :expected "nil" :actual "(next [1])"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "rest exhausts to ()" :expected "[]" :actual "(rest [1])"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "rest-loop scales (20k linear)" :expected "20000" :actual "(loop [xs (seq (vec (range 20000))) n 0] (if xs (recur (next xs) (inc n)) n))"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "mapv scales (50k linear)" :expected "50000" :actual "(count (mapv inc (vec (range 50000))))"}
|
|
{:suite "sequences / linear walks over concrete collections" :label "nested walk" :expected "[2 3]" :actual "(vec (rest (mapv inc [0 1 2])))"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "next of set" :expected "true" :actual "(let [n (next #{1 2})] (and (= 1 (count n)) (contains? #{1 2} (first n))))"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "rest of set count" :expected "1" :actual "(count (rest #{1 2}))"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "next of singleton set" :expected "nil" :actual "(next #{1})"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "rest of empty set" :expected "0" :actual "(count (rest #{}))"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "next of map" :expected "true" :actual "(let [n (next {:a 1 :b 2})] (and (= 1 (count n)) (map-entry? (first n))))"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "next of singleton map" :expected "nil" :actual "(next {:a 1})"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "rest of sorted-set" :expected "[2 3]" :actual "(rest (sorted-set 3 1 2))"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "next of sorted-map" :expected "[[2 :b]]" :actual "(next (sorted-map 1 :a 2 :b))"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "every? over set" :expected "true" :actual "(every? pos? #{1 2 3})"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "every? over set false" :expected "false" :actual "(every? odd? #{1 2})"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "every? over sorted-set" :expected "true" :actual "(every? pos? (sorted-set 1 2 3))"}
|
|
{:suite "sequences / rest & next over set-like colls" :label "every? over map entries" :expected "true" :actual "(every? map-entry? (seq {:a 1 :b 2}))"}
|
|
{:suite "set / construct & predicate" :label "literal" :expected "#{1 3 2}" :actual "#{1 2 3}"}
|
|
{:suite "set / construct & predicate" :label "hash-set" :expected "#{1 3 2}" :actual "(hash-set 1 2 3)"}
|
|
{:suite "set / construct & predicate" :label "set from vector" :expected "#{1 3 2}" :actual "(set [1 2 3 1])"}
|
|
{:suite "set / construct & predicate" :label "empty" :expected "#{}" :actual "#{}"}
|
|
{:suite "set / construct & predicate" :label "set? true" :expected "true" :actual "(set? #{1})"}
|
|
{:suite "set / construct & predicate" :label "set? false on vector" :expected "false" :actual "(set? [1])"}
|
|
{:suite "set / construct & predicate" :label "count dedups" :expected "3" :actual "(count (set [1 1 2 3]))"}
|
|
{:suite "set / construct & predicate" :label "equality order-indep" :expected "true" :actual "(= #{1 2 3} #{3 2 1})"}
|
|
{:suite "set / construct & predicate" :label "into set" :expected "#{:b :a}" :actual "(into #{} [:a :b])"}
|
|
{:suite "set / construct & predicate" :label "into non-empty set" :expected "#{1 3 2}" :actual "(into #{1} [2 3 2])"}
|
|
{:suite "set / operations" :label "conj adds" :expected "#{1 3 2}" :actual "(conj #{1 2} 3)"}
|
|
{:suite "set / operations" :label "conj dup no-op" :expected "#{1 2}" :actual "(conj #{1 2} 1)"}
|
|
{:suite "set / operations" :label "disj removes" :expected "#{1 2}" :actual "(disj #{1 2 3} 3)"}
|
|
{:suite "set / operations" :label "disj missing no-op" :expected "#{1 2}" :actual "(disj #{1 2} 9)"}
|
|
{:suite "set / operations" :label "contains?" :expected "true" :actual "(contains? #{1 2} 1)"}
|
|
{:suite "set / operations" :label "contains? missing" :expected "false" :actual "(contains? #{1 2} 9)"}
|
|
{:suite "set / operations" :label "get present" :expected "1" :actual "(get #{1 2} 1)"}
|
|
{:suite "set / operations" :label "get missing nil" :expected "nil" :actual "(get #{1 2} 9)"}
|
|
{:suite "set / operations" :label "set as fn present" :expected "2" :actual "(#{1 2 3} 2)"}
|
|
{:suite "set / operations" :label "set as fn missing" :expected "nil" :actual "(#{1 2 3} 9)"}
|
|
{:suite "set / literals & value elements" :label "literal evaluates elements" :expected "#{4 2}" :actual "#{(inc 1) (* 2 2)}"}
|
|
{:suite "set / literals & value elements" :label "map elements by value" :expected "true" :actual "(= #{{:a 1}} #{(hash-map :a 1)})"}
|
|
{:suite "set / literals & value elements" :label "contains? map by value" :expected "true" :actual "(contains? #{(hash-map :x 1)} {:x 1})"}
|
|
{:suite "set / literals & value elements" :label "dedup equal maps" :expected "1" :actual "(count (set [{:a 1} (hash-map :a 1)]))"}
|
|
{:suite "set / literals & value elements" :label "vector elements" :expected "true" :actual "(contains? #{[1 2]} (vec [1 2]))"}
|
|
{:suite "set / nil element" :label "set keeps nil" :expected "2" :actual "(count (set [nil 1 nil]))"}
|
|
{:suite "set / nil element" :label "contains? nil true" :expected "true" :actual "(contains? (set [nil 1]) nil)"}
|
|
{:suite "set / nil element" :label "contains? nil false" :expected "false" :actual "(contains? #{1} nil)"}
|
|
{:suite "set / nil element" :label "seq includes nil" :expected "true" :actual "(some nil? (seq (set [nil 1])))"}
|
|
{:suite "set / nil element" :label "disj nil" :expected "#{1}" :actual "(disj (set [nil 1]) nil)"}
|
|
{:suite "set / nil element" :label "disj nil count" :expected "1" :actual "(count (disj (set [nil 1]) nil))"}
|
|
{:suite "set / nil element" :label "conj nil count" :expected "2" :actual "(count (conj #{1} nil))"}
|
|
{:suite "set / nil element" :label "conj nil contains?" :expected "true" :actual "(contains? (conj #{1} nil) nil)"}
|
|
{:suite "set / nil element" :label "into #{} keeps nil" :expected "2" :actual "(count (into #{} [nil 1]))"}
|
|
{:suite "set / nil element" :label "into #{} contains? nil" :expected "true" :actual "(contains? (into #{} [nil 1]) nil)"}
|
|
{:suite "set / nil element" :label "into keeps existing nil" :expected "true" :actual "(contains? (into #{nil} [1]) nil)"}
|
|
{:suite "set / nil element" :label "transient conj! nil" :expected "2" :actual "(count (persistent! (conj! (transient #{}) nil 1)))"}
|
|
{:suite "set / nil element" :label "transient contains? nil" :expected "true" :actual "(contains? (persistent! (conj! (transient #{}) nil 1)) nil)"}
|
|
{:suite "set / nil element" :label "transient disj! nil cnt" :expected "1" :actual "(count (persistent! (disj! (conj! (transient #{}) nil 1) nil)))"}
|
|
{:suite "set / nil element" :label "transient disj! removes" :expected "false" :actual "(contains? (persistent! (disj! (conj! (transient #{}) nil 1) nil)) nil)"}
|
|
{:suite "set / nil element" :label "transient of set w/ nil" :expected "true" :actual "(contains? (persistent! (transient (set [nil 1]))) nil)"}
|
|
{:suite "clojure.set" :label "union" :expected "#{1 4 3 2}" :actual "(do (require (quote [clojure.set :as s])) (s/union #{1 2} #{3 4}))"}
|
|
{:suite "clojure.set" :label "intersection" :expected "#{2}" :actual "(do (require (quote [clojure.set :as s])) (s/intersection #{1 2} #{2 3}))"}
|
|
{:suite "clojure.set" :label "difference" :expected "#{1}" :actual "(do (require (quote [clojure.set :as s])) (s/difference #{1 2} #{2 3}))"}
|
|
{:suite "clojure.set" :label "subset? true" :expected "true" :actual "(do (require (quote [clojure.set :as s])) (s/subset? #{1} #{1 2}))"}
|
|
{:suite "clojure.set" :label "superset? true" :expected "true" :actual "(do (require (quote [clojure.set :as s])) (s/superset? #{1 2} #{1}))"}
|
|
{:suite "clojure.set" :label "select" :expected "#{4 2}" :actual "(do (require (quote [clojure.set :as s])) (s/select even? #{1 2 3 4}))"}
|
|
{:suite "clojure.set" :label "join" :expected "#{{:a 1, :b 2, :c 3}}" :actual "(do (require (quote [clojure.set :as s])) (s/join #{{:a 1 :b 2}} #{{:b 2 :c 3}}))"}
|
|
{:suite "clojure.set" :label "map-invert" :expected "{1 :a}" :actual "(do (require (quote [clojure.set :as s])) (s/map-invert {:a 1}))"}
|
|
{:suite "clojure.set" :label "rename-keys" :expected "{:b 1}" :actual "(do (require (quote [clojure.set :as s])) (s/rename-keys {:a 1} {:a :b}))"}
|
|
{:suite "set / set? across representations" :label "literal" :expected "true" :actual "(set? #{1})"}
|
|
{:suite "set / set? across representations" :label "empty literal" :expected "true" :actual "(set? #{})"}
|
|
{:suite "set / set? across representations" :label "sorted-set" :expected "true" :actual "(set? (sorted-set 1 2))"}
|
|
{:suite "set / set? across representations" :label "sorted-set-by" :expected "true" :actual "(set? (sorted-set-by > 1 2))"}
|
|
{:suite "set / set? across representations" :label "empty sorted" :expected "true" :actual "(set? (sorted-set))"}
|
|
{:suite "set / set? across representations" :label "map is not" :expected "false" :actual "(set? {})"}
|
|
{:suite "set / set? across representations" :label "vector is not" :expected "false" :actual "(set? [1])"}
|
|
{:suite "set / set? across representations" :label "coll? still true" :expected "true" :actual "(coll? (sorted-set 1))"}
|
|
{:suite "set / set? across representations" :label "ifn? sorted-set" :expected "true" :actual "(ifn? (sorted-set 1))"}
|
|
{:suite "set / bulk build boundaries" :label "set dedup count" :expected "3" :actual "(count (set [1 1 2 3 3 2]))"}
|
|
{:suite "set / bulk build boundaries" :label "set big count" :expected "1000" :actual "(count (set (range 1000)))"}
|
|
{:suite "set / bulk build boundaries" :label "into #{} count" :expected "500" :actual "(count (into #{} (range 500)))"}
|
|
{:suite "set / bulk build boundaries" :label "into #{} onto base" :expected "3" :actual "(count (into #{:a} [:a :b :c]))"}
|
|
{:suite "set / bulk build boundaries" :label "set contains" :expected "true" :actual "(contains? (set (range 1000)) 777)"}
|
|
{:suite "set / bulk build boundaries" :label "set missing" :expected "false" :actual "(contains? (set (range 1000)) 5000)"}
|
|
{:suite "set / bulk build boundaries" :label "set coll members" :expected "true" :actual "(contains? (set [[1 2] [3 4]]) [1 2])"}
|
|
{:suite "set / bulk build boundaries" :label "conj after bulk" :expected "true" :actual "(contains? (conj (set (range 100)) :x) :x)"}
|
|
{:suite "set / bulk build boundaries" :label "disj after bulk" :expected "false" :actual "(contains? (disj (set (range 100)) 50) 50)"}
|
|
{:suite "set / bulk build boundaries" :label "set = literal" :expected "true" :actual "(= #{0 1 2} (set (range 3)))"}
|
|
{:suite "sorted / construction & ordering" :label "sorted-set orders" :expected "[1 2 3]" :actual "(vec (seq (sorted-set 3 1 2)))"}
|
|
{:suite "sorted / construction & ordering" :label "sorted-set dedupes" :expected "[1 2 3]" :actual "(vec (seq (sorted-set 3 1 2 1 3)))"}
|
|
{:suite "sorted / construction & ordering" :label "sorted-set numeric" :expected "[1 2 10]" :actual "(vec (seq (sorted-set 10 1 2)))"}
|
|
{:suite "sorted / construction & ordering" :label "sorted-map ordered entries" :expected "[[:a 1] [:b 2] [:c 3]]" :actual "(vec (seq (sorted-map :c 3 :a 1 :b 2)))"}
|
|
{:suite "sorted / construction & ordering" :label "first is min" :expected "1" :actual "(first (sorted-set 5 3 9 1))"}
|
|
{:suite "sorted / sorted?" :label "sorted-set" :expected "true" :actual "(sorted? (sorted-set 1))"}
|
|
{:suite "sorted / sorted?" :label "sorted-map" :expected "true" :actual "(sorted? (sorted-map :a 1))"}
|
|
{:suite "sorted / sorted?" :label "plain set" :expected "false" :actual "(sorted? #{1})"}
|
|
{:suite "sorted / sorted?" :label "plain map" :expected "false" :actual "(sorted? {:a 1})"}
|
|
{:suite "sorted / sorted?" :label "vector" :expected "false" :actual "(sorted? [1 2])"}
|
|
{:suite "sorted / map ops" :label "get hit" :expected "2" :actual "(get (sorted-map :a 1 :b 2) :b)"}
|
|
{:suite "sorted / map ops" :label "get miss default" :expected ":none" :actual "(get (sorted-map :a 1) :z :none)"}
|
|
{:suite "sorted / map ops" :label "contains? yes" :expected "true" :actual "(contains? (sorted-map :a 1) :a)"}
|
|
{:suite "sorted / map ops" :label "contains? no" :expected "false" :actual "(contains? (sorted-map :a 1) :z)"}
|
|
{:suite "sorted / map ops" :label "assoc keeps order" :expected "[[:a 1] [:b 2] [:c 3]]" :actual "(vec (seq (assoc (sorted-map :c 3 :a 1) :b 2)))"}
|
|
{:suite "sorted / map ops" :label "dissoc" :expected "[[:a 1] [:c 3]]" :actual "(vec (seq (dissoc (sorted-map :a 1 :b 2 :c 3) :b)))"}
|
|
{:suite "sorted / map ops" :label "conj entry" :expected "[[:a 1] [:z 9]]" :actual "(vec (seq (conj (sorted-map :a 1) [:z 9])))"}
|
|
{:suite "sorted / map ops" :label "keys sorted" :expected "[:a :b :c]" :actual "(vec (keys (sorted-map :c 3 :a 1 :b 2)))"}
|
|
{:suite "sorted / map ops" :label "vals by key" :expected "[1 2 3]" :actual "(vec (vals (sorted-map :c 3 :a 1 :b 2)))"}
|
|
{:suite "sorted / map ops" :label "map as fn" :expected "2" :actual "((sorted-map :a 1 :b 2) :b)"}
|
|
{:suite "sorted / map ops" :label "map as fn miss" :expected ":d" :actual "((sorted-map :a 1) :z :d)"}
|
|
{:suite "sorted / set ops" :label "get present" :expected "2" :actual "(get (sorted-set 1 2 3) 2)"}
|
|
{:suite "sorted / set ops" :label "get absent" :expected ":none" :actual "(get (sorted-set 1 2 3) 9 :none)"}
|
|
{:suite "sorted / set ops" :label "contains? yes" :expected "true" :actual "(contains? (sorted-set 1 2 3) 2)"}
|
|
{:suite "sorted / set ops" :label "contains? no" :expected "false" :actual "(contains? (sorted-set 1 2 3) 9)"}
|
|
{:suite "sorted / set ops" :label "conj keeps order" :expected "[0 1 2 3 5]" :actual "(vec (seq (conj (sorted-set 1 2 3) 5 0)))"}
|
|
{:suite "sorted / set ops" :label "disj" :expected "[1 3]" :actual "(vec (seq (disj (sorted-set 1 2 3) 2)))"}
|
|
{:suite "sorted / set ops" :label "set as fn" :expected "3" :actual "((sorted-set 1 2 3) 3)"}
|
|
{:suite "sorted / set ops" :label "set as fn miss" :expected "nil" :actual "((sorted-set 1 2 3) 9)"}
|
|
{:suite "sorted / by comparator" :label "sorted-set-by desc" :expected "[10 3 2 1]" :actual "(vec (seq (sorted-set-by > 1 3 2 10)))"}
|
|
{:suite "sorted / by comparator" :label "sorted-map-by desc" :expected "[[3 :c] [2 :b] [1 :a]]" :actual "(vec (seq (sorted-map-by > 1 :a 3 :c 2 :b)))"}
|
|
{:suite "sorted / by comparator" :label "conj keeps comparator" :expected "[5 3 2 1 0]" :actual "(vec (seq (conj (sorted-set-by > 1 3 2) 5 0)))"}
|
|
{:suite "sorted / by comparator" :label "assoc keeps comparator" :expected "[3 2 1]" :actual "(vec (keys (assoc (sorted-map-by > 1 :a 3 :c) 2 :b)))"}
|
|
{:suite "sorted / by comparator" :label "disj keeps comparator" :expected "[3 1]" :actual "(vec (seq (disj (sorted-set-by > 1 2 3) 2)))"}
|
|
{:suite "sorted / by comparator" :label "by-comparator is sorted?" :expected "true" :actual "(sorted? (sorted-set-by > 1 2))"}
|
|
{:suite "sorted / subseq & rsubseq" :label "subseq >=" :expected "[3 4 5]" :actual "(vec (subseq (sorted-set 1 2 3 4 5) >= 3))"}
|
|
{:suite "sorted / subseq & rsubseq" :label "subseq <" :expected "[1 2]" :actual "(vec (subseq (sorted-set 1 2 3 4 5) < 3))"}
|
|
{:suite "sorted / subseq & rsubseq" :label "subseq range" :expected "[2 3 4]" :actual "(vec (subseq (sorted-set 1 2 3 4 5) > 1 < 5))"}
|
|
{:suite "sorted / subseq & rsubseq" :label "rsubseq <=" :expected "[3 2 1]" :actual "(vec (rsubseq (sorted-set 1 2 3 4 5) <= 3))"}
|
|
{:suite "sorted / subseq & rsubseq" :label "subseq on map" :expected "[[2 :b] [3 :c]]" :actual "(vec (subseq (sorted-map 1 :a 2 :b 3 :c) > 1))"}
|
|
{:suite "sorted / subseq & rsubseq" :label "subseq empty result" :expected "nil" :actual "(subseq (sorted-set 1 2) > 5)"}
|
|
{:suite "sorted / subseq & rsubseq" :label "rsubseq on map" :expected "[[2 :b] [1 :a]]" :actual "(vec (rsubseq (sorted-map 1 :a 2 :b 3 :c) < 3))"}
|
|
{:suite "sorted / predicates" :label "sorted-map? true" :expected "true" :actual "(sorted-map? (sorted-map 1 :a))"}
|
|
{:suite "sorted / predicates" :label "sorted-map? false" :expected "false" :actual "(sorted-map? {:a 1})"}
|
|
{:suite "sorted / predicates" :label "sorted-set? true" :expected "true" :actual "(sorted-set? (sorted-set 1))"}
|
|
{:suite "sorted / predicates" :label "sorted-set? false" :expected "false" :actual "(sorted-set? #{1})"}
|
|
{:suite "sorted / predicates" :label "map? sorted-map" :expected "true" :actual "(map? (sorted-map 1 :a))"}
|
|
{:suite "sorted / predicates" :label "coll? sorted-set" :expected "true" :actual "(coll? (sorted-set 1))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "get cross-numeric" :expected ":a" :actual "(get (sorted-map 1 :a) 1.0)"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "contains? cross-numeric" :expected "true" :actual "(contains? (sorted-set 1) 1.0)"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "conj equal elem no-op" :expected "1" :actual "(count (conj (sorted-set 1) 1.0))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "assoc equal key replaces" :expected "[[1 :z]]" :actual "(vec (seq (assoc (sorted-map 1 :a) 1.0 :z)))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "first sorted-map" :expected "[1 :a]" :actual "(first (sorted-map 2 :b 1 :a))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "dissoc missing no-op" :expected "2" :actual "(count (dissoc (sorted-map 1 :a 2 :b) 9))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "conj map merges" :expected "3" :actual "(count (conj (sorted-map 1 :a) {2 :b 3 :c}))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "conj nil no-op" :expected "1" :actual "(count (conj (sorted-map 1 :a) nil))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "into sorted-map" :expected "[[1 :a] [2 :b]]" :actual "(vec (seq (into (sorted-map) [[2 :b] [1 :a]])))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "source unchanged" :expected "[1 2]" :actual "(let [s (sorted-set 1 2)] (conj s 9) (vec (seq s)))"}
|
|
{:suite "sorted / lookup + membership use the comparator" :label "sorted-map odd kvs throws" :expected :throws :actual "(sorted-map 1 :a 2)"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "sorted-map = literal" :expected "true" :actual "(= (sorted-map :a 1 :b 2) {:a 1 :b 2})"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "literal = sorted-map" :expected "true" :actual "(= {:a 1 :b 2} (sorted-map :a 1 :b 2))"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "sorted-map = hash-map" :expected "true" :actual "(= (sorted-map :a 1) (hash-map :a 1))"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "sorted-map != more keys" :expected "false" :actual "(= (sorted-map :a 1) {:a 1 :b 2})"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "sorted-set = literal" :expected "true" :actual "(= (sorted-set 1 2) #{1 2})"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "literal = sorted-set" :expected "true" :actual "(= #{1 2} (sorted-set 2 1))"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "sorted-set != diff" :expected "false" :actual "(= (sorted-set 1 2) #{1 3})"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "two sorted-maps" :expected "true" :actual "(= (sorted-map 1 :a 2 :b) (sorted-map 2 :b 1 :a))"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "cmp irrelevant to =" :expected "true" :actual "(= (sorted-map-by > 1 :a 2 :b) (sorted-map 1 :a 2 :b))"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "sorted-map as map key" :expected ":hit" :actual "(get {(sorted-map :a 1) :hit} {:a 1})"}
|
|
{:suite "sorted / equality is representation-agnostic" :label "sorted-set as map key" :expected ":hit" :actual "(get {(sorted-set 1 2) :hit} #{2 1})"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "empty? empty map" :expected "true" :actual "(empty? (sorted-map))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "empty? non-empty" :expected "false" :actual "(empty? (sorted-map 1 :a))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "empty? empty set" :expected "true" :actual "(empty? (sorted-set))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "empty keeps sortedness" :expected "true" :actual "(sorted? (empty (sorted-map 1 :a)))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "empty keeps cmp" :expected "[3 1]" :actual "(vec (seq (into (empty (sorted-set-by > 1 2)) [1 3])))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "empty set kind" :expected "true" :actual "(sorted-set? (empty (sorted-set 1)))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "rseq map" :expected "[[2 :b] [1 :a]]" :actual "(vec (rseq (sorted-map 1 :a 2 :b)))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "rseq set" :expected "[3 2 1]" :actual "(vec (rseq (sorted-set 1 2 3)))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "pr-str sorted-map" :expected "\"{1 :a, 2 :b}\"" :actual "(pr-str (sorted-map 2 :b 1 :a))"}
|
|
{:suite "sorted / empty + empty? + rseq + printing" :label "pr-str sorted-set" :expected "\"#{1 2 3}\"" :actual "(pr-str (sorted-set 3 1 2))"}
|
|
{:suite "sorted / seq fn interop" :label "map over sorted-map" :expected "[1 2 3]" :actual "(vec (map first (sorted-map 2 :b 1 :a 3 :c)))"}
|
|
{:suite "sorted / seq fn interop" :label "map over sorted-set" :expected "[2 3 4]" :actual "(vec (map inc (sorted-set 3 1 2)))"}
|
|
{:suite "sorted / seq fn interop" :label "filter entries" :expected "[[2 :b]]" :actual "(vec (filter (fn [[k v]] (even? k)) (sorted-map 1 :a 2 :b)))"}
|
|
{:suite "sorted / seq fn interop" :label "reduce over set" :expected "6" :actual "(reduce + (sorted-set 1 2 3))"}
|
|
{:suite "sorted / seq fn interop" :label "vec of sorted-set" :expected "[1 2 3]" :actual "(vec (sorted-set 3 1 2))"}
|
|
{:suite "sorted / seq fn interop" :label "into vec" :expected "[[1 :a] [2 :b]]" :actual "(into [] (sorted-map 2 :b 1 :a))"}
|
|
{:suite "sorted / seq fn interop" :label "sorted-map-by 3way cmp" :expected "[3 2 1]" :actual "(vec (keys (sorted-map-by (fn [a b] (- b a)) 1 :a 2 :b 3 :c)))"}
|
|
{:suite "io / slurp, spit, printf, flush (host-classified)" :label "slurp returns string" :expected "true" :actual "(string? (slurp \"README.md\"))"}
|
|
{:suite "io / slurp, spit, printf, flush (host-classified)" :label "slurp content" :expected "true" :actual "(do (require (quote [clojure.string :as s])) (s/includes? (slurp \"README.md\") \"jolt\"))"}
|
|
{:suite "io / slurp, spit, printf, flush (host-classified)" :label "spit + slurp round" :expected "\"hello\"" :actual "(do (spit \"/tmp/jolt-spit-test.txt\" \"hello\") (slurp \"/tmp/jolt-spit-test.txt\"))"}
|
|
{:suite "io / slurp, spit, printf, flush (host-classified)" :label "spit append" :expected "\"ab\"" :actual "(do (spit \"/tmp/jolt-spit-test.txt\" \"a\") (spit \"/tmp/jolt-spit-test.txt\" \"b\" :append true) (slurp \"/tmp/jolt-spit-test.txt\"))"}
|
|
{:suite "io / slurp, spit, printf, flush (host-classified)" :label "printf formats" :expected "\"x=1 y=a\"" :actual "(with-out-str (printf \"x=%d y=%s\" 1 \"a\"))"}
|
|
{:suite "io / slurp, spit, printf, flush (host-classified)" :label "printf no newline" :expected "false" :actual "(do (require (quote [clojure.string :as s])) (s/includes? (with-out-str (printf \"%d\" 1)) \"\\n\"))"}
|
|
{:suite "io / slurp, spit, printf, flush (host-classified)" :label "flush returns nil" :expected "nil" :actual "(flush)"}
|
|
{:suite "io / slurp, spit, printf, flush (host-classified)" :label "file-seq finds files" :expected "true" :actual "(do (require (quote [clojure.string :as s])) (boolean (some (fn [p] (s/ends-with? p \"README.md\")) (file-seq \".\"))))"}
|
|
{:suite "ns / ns-map, ns-unmap, ns-refers" :label "ns-map has var" :expected "true" :actual "(do (def nmv 1) (some? (get (ns-map (quote user)) (quote nmv))))"}
|
|
{:suite "ns / ns-map, ns-unmap, ns-refers" :label "ns-unmap removes" :expected "nil" :actual "(do (def nuv 1) (ns-unmap (quote user) (quote nuv)) (resolve (quote nuv)))"}
|
|
{:suite "ns / ns-map, ns-unmap, ns-refers" :label "ns-refers sees refer" :expected "true" :actual "(do (require (quote clojure.string)) (refer (quote clojure.string)) (some? (get (ns-refers (quote user)) (quote join))))"}
|
|
{:suite "vars / thread-binding family" :label "bound? on def" :expected "true" :actual "(do (def bvv 1) (bound? (var bvv)))"}
|
|
{:suite "vars / thread-binding family" :label "with-bindings* binds" :expected "5" :actual "(do (def ^:dynamic dynv 1) (with-bindings* (array-map (var dynv) 5) (fn [] dynv)))"}
|
|
{:suite "vars / thread-binding family" :label "with-bindings* restores" :expected "1" :actual "(do (def ^:dynamic dynw 1) (with-bindings* (array-map (var dynw) 5) (fn [] nil)) dynw)"}
|
|
{:suite "vars / thread-binding family" :label "with-bindings macro" :expected "7" :actual "(do (def ^:dynamic dynx 1) (with-bindings (array-map (var dynx) 7) dynx))"}
|
|
{:suite "vars / thread-binding family" :label "thread-bound? inside" :expected "[true false]" :actual "(do (def ^:dynamic dyny 1) [(with-bindings* (array-map (var dyny) 2) (fn [] (thread-bound? (var dyny)))) (thread-bound? (var dyny))])"}
|
|
{:suite "vars / thread-binding family" :label "bound-fn* conveys" :expected "9" :actual "(do (def ^:dynamic dynz 1) (def f (with-bindings* (array-map (var dynz) 9) (fn [] (bound-fn* (fn [] dynz))))) (f))"}
|
|
{:suite "vars / thread-binding family" :label "get-thread-bindings" :expected "3" :actual "(do (def ^:dynamic dyng 1) (with-bindings* (array-map (var dyng) 3) (fn [] (get (get-thread-bindings) (var dyng)))))"}
|
|
{:suite "eval & load-string as values" :label "load-string evals all" :expected "3" :actual "(load-string \"(def lsv 1) (+ lsv 2)\")"}
|
|
{:suite "eval & load-string as values" :label "eval as value" :expected "[2 3]" :actual "(mapv eval [(quote (+ 1 1)) (quote (+ 1 2))])"}
|
|
{:suite "eval & load-string as values" :label "eval special still works" :expected "3" :actual "(eval (quote (+ 1 2)))"}
|
|
{:suite "clojure.edn / opts" :label "set literal" :expected "#{1 2}" :actual "(do (require (quote [clojure.edn :as e0])) (e0/read-string \"#{1 2}\"))"}
|
|
{:suite "clojure.edn / opts" :label "uuid tag" :expected "true" :actual "(do (require (quote [clojure.edn :as e0])) (uuid? (e0/read-string \"#uuid \\\"550e8400-e29b-41d4-a716-446655440000\\\"\")))"}
|
|
{:suite "clojure.edn / opts" :label "inst tag" :expected "true" :actual "(do (require (quote [clojure.edn :as e0])) (inst? (e0/read-string \"#inst \\\"2020-01-01T00:00:00Z\\\"\")))"}
|
|
{:suite "clojure.edn / opts" :label ":eof on empty" :expected ":end" :actual "(do (require (quote [clojure.edn :as e0])) (e0/read-string {:eof :end} \"\"))"}
|
|
{:suite "clojure.edn / opts" :label ":readers custom tag" :expected "[:custom 5]" :actual "(do (require (quote [clojure.edn :as e0])) (e0/read-string {:readers {(quote custom) (fn [v] [:custom v])}} \"#custom 5\"))"}
|
|
{:suite "clojure.edn / opts" :label ":readers nested" :expected "[6 8]" :actual "(do (require (quote [clojure.edn :as e0])) (e0/read-string {:readers {(quote w) (fn [v] (* 2 v))}} \"[#w 3 #w 4]\"))"}
|
|
{:suite "clojure.edn / opts" :label ":default fn" :expected "[:dflt 7]" :actual "(do (require (quote [clojure.edn :as e0])) (e0/read-string {:default (fn [t v] [:dflt v])} \"#unknown 7\"))"}
|
|
{:suite "clojure.edn / opts" :label "unknown tag throws" :expected :throws :actual "(do (require (quote [clojure.edn :as e0])) (e0/read-string \"#nope 1\"))"}
|
|
{:suite "state / atoms" :label "deref @" :expected "0" :actual "(let [a (atom 0)] @a)"}
|
|
{:suite "state / atoms" :label "deref fn" :expected "0" :actual "(deref (atom 0))"}
|
|
{:suite "state / atoms" :label "reset!" :expected "5" :actual "(let [a (atom 0)] (reset! a 5) @a)"}
|
|
{:suite "state / atoms" :label "reset! returns new" :expected "5" :actual "(let [a (atom 0)] (reset! a 5))"}
|
|
{:suite "state / atoms" :label "swap!" :expected "1" :actual "(let [a (atom 0)] (swap! a inc) @a)"}
|
|
{:suite "state / atoms" :label "swap! with args" :expected "10" :actual "(let [a (atom 1)] (swap! a + 2 3 4) @a)"}
|
|
{:suite "state / atoms" :label "swap! returns new" :expected "1" :actual "(let [a (atom 0)] (swap! a inc))"}
|
|
{:suite "state / atoms" :label "swap-vals!" :expected "[0 1]" :actual "(let [a (atom 0)] (swap-vals! a inc))"}
|
|
{:suite "state / atoms" :label "reset-vals!" :expected "[0 9]" :actual "(let [a (atom 0)] (reset-vals! a 9))"}
|
|
{:suite "state / atoms" :label "compare-and-set! ok" :expected "true" :actual "(let [a (atom 0)] (compare-and-set! a 0 1))"}
|
|
{:suite "state / atoms" :label "compare-and-set! no" :expected "false" :actual "(let [a (atom 0)] (compare-and-set! a 9 1))"}
|
|
{:suite "state / atoms" :label "atom?" :expected "true" :actual "(do (require (quote [clojure.core])) (instance? clojure.lang.Atom (atom 0)))"}
|
|
{:suite "state / atoms" :label "atom? predicate" :expected "true" :actual "(atom? (atom 0))"}
|
|
{:suite "state / atoms" :label "atom? on non-atom" :expected "false" :actual "(atom? 5)"}
|
|
{:suite "state / watches & validators" :label "add-watch fires" :expected "1" :actual "(let [a (atom 0) seen (atom 0)] (add-watch a :k (fn [k r o n] (reset! seen 1))) (reset! a 5) @seen)"}
|
|
{:suite "state / watches & validators" :label "remove-watch" :expected "0" :actual "(let [a (atom 0) seen (atom 0)] (add-watch a :k (fn [k r o n] (swap! seen inc))) (remove-watch a :k) (reset! a 5) @seen)"}
|
|
{:suite "state / watches & validators" :label "set-validator! ok" :expected "5" :actual "(let [a (atom 0)] (set-validator! a number?) (reset! a 5) @a)"}
|
|
{:suite "state / watches & validators" :label "set-validator! rejects" :expected :throws :actual "(let [a (atom 0)] (set-validator! a pos?) (reset! a -1))"}
|
|
{:suite "state / watches & validators" :label "get-validator" :expected "true" :actual "(let [a (atom 0)] (set-validator! a number?) (fn? (get-validator a)))"}
|
|
{:suite "state / volatiles & delays" :label "volatile! deref" :expected "0" :actual "(let [v (volatile! 0)] @v)"}
|
|
{:suite "state / volatiles & delays" :label "vreset!" :expected "5" :actual "(let [v (volatile! 0)] (vreset! v 5) @v)"}
|
|
{:suite "state / volatiles & delays" :label "vswap!" :expected "1" :actual "(let [v (volatile! 0)] (vswap! v inc) @v)"}
|
|
{:suite "state / volatiles & delays" :label "delay not forced" :expected "0" :actual "(let [c (atom 0) d (delay (swap! c inc))] @c)"}
|
|
{:suite "state / volatiles & delays" :label "delay force once" :expected "1" :actual "(let [c (atom 0) d (delay (swap! c inc))] (force d) (force d) @c)"}
|
|
{:suite "state / volatiles & delays" :label "delay value" :expected "5" :actual "(let [d (delay 5)] @d)"}
|
|
{:suite "state / volatiles & delays" :label "realized? before" :expected "false" :actual "(let [d (delay 5)] (realized? d))"}
|
|
{:suite "state / volatiles & delays" :label "realized? after" :expected "true" :actual "(let [d (delay 5)] (force d) (realized? d))"}
|
|
{:suite "state / promises" :label "promise deliver" :expected "5" :actual "(let [p (promise)] (deliver p 5) @p)"}
|
|
{:suite "state / promises" :label "promise undelivered" :expected "nil" :actual "(let [p (promise)] @p)"}
|
|
{:suite "state / agents (synchronous shim)" :label "agent deref" :expected "0" :actual "(deref (agent 0))"}
|
|
{:suite "state / agents (synchronous shim)" :label "agent with opts" :expected "0" :actual "(deref (agent 0 :error-mode :continue))"}
|
|
{:suite "state / agents (synchronous shim)" :label "send-off applies" :expected "0" :actual "(let [a (agent 0)] (send-off a (fn [x] (Thread/sleep 100) (+ x 5))) (deref a))"}
|
|
{:suite "state / agents (synchronous shim)" :label "send applies" :expected "1" :actual "(let [a (agent 1)] (send a (fn [x] (Thread/sleep 100) (+ x 6))) (deref a))"}
|
|
{:suite "state / agents (synchronous shim)" :label "agent-error nil" :expected "nil" :actual "(agent-error (agent 0))"}
|
|
{:suite "string / str & basics" :label "str concat" :expected "\"abc\"" :actual "(str \"a\" \"b\" \"c\")"}
|
|
{:suite "string / str & basics" :label "str of numbers" :expected "\"12\"" :actual "(str 1 2)"}
|
|
{:suite "string / str & basics" :label "str nil is empty" :expected "\"\"" :actual "(str nil)"}
|
|
{:suite "string / str & basics" :label "str mixed" :expected "\"a1:b\"" :actual "(str \"a\" 1 :b)"}
|
|
{:suite "string / str & basics" :label "str of coll" :expected "\"[1 2]\"" :actual "(str [1 2])"}
|
|
{:suite "string / str & basics" :label "count" :expected "3" :actual "(count \"abc\")"}
|
|
{:suite "string / str & basics" :label "subs from" :expected "\"bc\"" :actual "(subs \"abc\" 1)"}
|
|
{:suite "string / str & basics" :label "subs range" :expected "\"b\"" :actual "(subs \"abc\" 1 2)"}
|
|
{:suite "string / str & basics" :label "string? true" :expected "true" :actual "(string? \"x\")"}
|
|
{:suite "string / str & basics" :label "pr-str vector" :expected "\"[1 2 3]\"" :actual "(pr-str [1 2 3])"}
|
|
{:suite "string / str & basics" :label "pr-str quotes str" :expected "\"\\\"hi\\\"\"" :actual "(pr-str \"hi\")"}
|
|
{:suite "string / str & basics" :label "pr-str of a var" :expected "\"#'user/vv\"" :actual "(pr-str (def vv 1))"}
|
|
{:suite "string / str & basics" :label "str of a var" :expected "\"#'user/ww\"" :actual "(str (def ww 2))"}
|
|
{:suite "string / str & basics" :label "pr-str of a defn" :expected "\"#'user/gg\"" :actual "(pr-str (defn gg [x] x))"}
|
|
{:suite "string / str & basics" :label "seq of string" :expected "[\\a \\b]" :actual "(seq \"ab\")"}
|
|
{:suite "string as a seqable of chars" :label "vec of string" :expected "[\\a \\b]" :actual "(vec \"ab\")"}
|
|
{:suite "string as a seqable of chars" :label "into [] of string" :expected "[\\a \\b]" :actual "(into [] \"ab\")"}
|
|
{:suite "string as a seqable of chars" :label "set of string" :expected "true" :actual "(= #{\\a \\b} (set \"ab\"))"}
|
|
{:suite "string as a seqable of chars" :label "into #{} of string" :expected "true" :actual "(= #{\\a \\b} (into #{} \"ab\"))"}
|
|
{:suite "string as a seqable of chars" :label "set dedups chars" :expected "2" :actual "(count (set \"aab\"))"}
|
|
{:suite "string as a seqable of chars" :label "mapv over string" :expected "[\\a \\b]" :actual "(mapv identity \"ab\")"}
|
|
{:suite "clojure.string / split limit" :label "neg keeps trailing" :expected "[\"a\" \"\" \"\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"a,,\" #\",\" -1))"}
|
|
{:suite "clojure.string / split limit" :label "zero trims trailing" :expected "[\"a\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"a,,\" #\",\" 0))"}
|
|
{:suite "clojure.string / split limit" :label "omitted trims" :expected "[\"a\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"a,,\" #\",\"))"}
|
|
{:suite "clojure.string / split limit" :label "positive caps parts" :expected "[\"a\" \"b,c\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"a,b,c\" #\",\" 2))"}
|
|
{:suite "clojure.string / split limit" :label "empty string" :expected "[\"\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"\" #\",\"))"}
|
|
{:suite "clojure.string / split limit" :label "interior empties kept" :expected "[\"a\" \"\" \"b\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"a,,b\" #\",\"))"}
|
|
{:suite "clojure.string" :label "join" :expected "\"a,b,c\"" :actual "(do (require (quote [clojure.string :as s])) (s/join \",\" [\"a\" \"b\" \"c\"]))"}
|
|
{:suite "clojure.string" :label "join no sep" :expected "\"abc\"" :actual "(do (require (quote [clojure.string :as s])) (s/join [\"a\" \"b\" \"c\"]))"}
|
|
{:suite "clojure.string" :label "split" :expected "[\"a\" \"b\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"a,b\" #\",\"))"}
|
|
{:suite "clojure.string" :label "split-lines" :expected "[\"a\" \"b\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split-lines \"a\\nb\"))"}
|
|
{:suite "clojure.string" :label "upper-case" :expected "\"ABC\"" :actual "(do (require (quote [clojure.string :as s])) (s/upper-case \"abc\"))"}
|
|
{:suite "clojure.string" :label "lower-case" :expected "\"abc\"" :actual "(do (require (quote [clojure.string :as s])) (s/lower-case \"ABC\"))"}
|
|
{:suite "clojure.string" :label "capitalize" :expected "\"Abc\"" :actual "(do (require (quote [clojure.string :as s])) (s/capitalize \"abc\"))"}
|
|
{:suite "clojure.string" :label "trim" :expected "\"x\"" :actual "(do (require (quote [clojure.string :as s])) (s/trim \" x \"))"}
|
|
{:suite "clojure.string" :label "triml" :expected "\"x \"" :actual "(do (require (quote [clojure.string :as s])) (s/triml \" x \"))"}
|
|
{:suite "clojure.string" :label "blank? true" :expected "true" :actual "(do (require (quote [clojure.string :as s])) (s/blank? \" \"))"}
|
|
{:suite "clojure.string" :label "blank? false" :expected "false" :actual "(do (require (quote [clojure.string :as s])) (s/blank? \"x\"))"}
|
|
{:suite "clojure.string" :label "includes?" :expected "true" :actual "(do (require (quote [clojure.string :as s])) (s/includes? \"hello\" \"ell\"))"}
|
|
{:suite "clojure.string" :label "starts-with?" :expected "true" :actual "(do (require (quote [clojure.string :as s])) (s/starts-with? \"hello\" \"he\"))"}
|
|
{:suite "clojure.string" :label "ends-with?" :expected "true" :actual "(do (require (quote [clojure.string :as s])) (s/ends-with? \"hello\" \"lo\"))"}
|
|
{:suite "clojure.string" :label "replace" :expected "\"hexxo\"" :actual "(do (require (quote [clojure.string :as s])) (s/replace \"hello\" \"l\" \"x\"))"}
|
|
{:suite "clojure.string" :label "reverse" :expected "\"cba\"" :actual "(do (require (quote [clojure.string :as s])) (s/reverse \"abc\"))"}
|
|
{:suite "clojure.string" :label "index-of" :expected "2" :actual "(do (require (quote [clojure.string :as s])) (s/index-of \"hello\" \"l\"))"}
|
|
{:suite "string / subs strictness" :label "subs basic" :expected "\"bcd\"" :actual "(subs \"abcde\" 1 4)"}
|
|
{:suite "string / subs strictness" :label "subs to end" :expected "\"cde\"" :actual "(subs \"abcde\" 2)"}
|
|
{:suite "string / subs strictness" :label "subs start>end" :expected :throws :actual "(subs \"abcde\" 2 1)"}
|
|
{:suite "string / subs strictness" :label "subs negative" :expected :throws :actual "(subs \"abcde\" -1)"}
|
|
{:suite "string / subs strictness" :label "subs end past len" :expected :throws :actual "(subs \"abcde\" 1 6)"}
|
|
{:suite "string / subs strictness" :label "subs nil start" :expected :throws :actual "(subs \"abcde\" nil 2)"}
|
|
{:suite "string / subs strictness" :label "subs on nil" :expected :throws :actual "(subs nil 1 2)"}
|
|
{:suite "string / namespace-munge" :label "hyphens to underscores" :expected "\"a_b_c\"" :actual "(namespace-munge \"a-b-c\")"}
|
|
{:suite "string / namespace-munge" :label "from a symbol" :expected "\"foo_bar\"" :actual "(namespace-munge (quote foo-bar))"}
|
|
{:suite "string / namespace-munge" :label "no hyphens unchanged" :expected "\"ok\"" :actual "(namespace-munge \"ok\")"}
|
|
{:suite "strings / get indexes a string" :label "get returns the char" :expected "true" :actual "(= (get \"a:b\" 1) \\:)"}
|
|
{:suite "strings / get indexes a string" :label "get first char" :expected "\\a" :actual "(get \"abc\" 0)"}
|
|
{:suite "strings / get indexes a string" :label "get out of range nil" :expected "nil" :actual "(get \"abc\" 9)"}
|
|
{:suite "strings / get indexes a string" :label "get negative nil" :expected "nil" :actual "(get \"abc\" -1)"}
|
|
{:suite "strings / get indexes a string" :label "get default honored" :expected ":none" :actual "(get \"abc\" 9 :none)"}
|
|
{:suite "clojure.string / trim-newline" :label "trailing newline" :expected "\"x\"" :actual "(do (require (quote [clojure.string :as s])) (s/trim-newline \"x\\n\"))"}
|
|
{:suite "clojure.string / trim-newline" :label "trailing \\r\\n" :expected "\"x\"" :actual "(do (require (quote [clojure.string :as s])) (s/trim-newline \"x\\r\\n\"))"}
|
|
{:suite "clojure.string / trim-newline" :label "no trailing" :expected "\"ab\"" :actual "(do (require (quote [clojure.string :as s])) (s/trim-newline \"ab\"))"}
|
|
{:suite "clojure.string / trim-newline" :label "only newlines" :expected "\"\"" :actual "(do (require (quote [clojure.string :as s])) (s/trim-newline \"\\n\\n\"))"}
|
|
{:suite "clojure.string / trim-newline" :label "interior kept" :expected "\"a\\nb\"" :actual "(do (require (quote [clojure.string :as s])) (s/trim-newline \"a\\nb\\n\"))"}
|
|
{:suite "transducers / into" :label "map xform" :expected "[2 3 4]" :actual "(into [] (map inc) [1 2 3])"}
|
|
{:suite "transducers / into" :label "filter xform" :expected "[2 4]" :actual "(into [] (filter even?) [1 2 3 4])"}
|
|
{:suite "transducers / into" :label "remove xform" :expected "[1 3]" :actual "(into [] (remove even?) [1 2 3 4])"}
|
|
{:suite "transducers / into" :label "take xform" :expected "[1 2]" :actual "(into [] (take 2) [1 2 3 4])"}
|
|
{:suite "transducers / into" :label "drop xform" :expected "[3 4]" :actual "(into [] (drop 2) [1 2 3 4])"}
|
|
{:suite "transducers / into" :label "take-while xform" :expected "[1 2]" :actual "(into [] (take-while (fn [x] (< x 3))) [1 2 3 1])"}
|
|
{:suite "transducers / into" :label "keep xform" :expected "[1 3]" :actual "(into [] (keep (fn [x] (if (odd? x) x nil))) [1 2 3 4])"}
|
|
{:suite "transducers / into" :label "map-indexed xform" :expected "[[0 :a] [1 :b]]" :actual "(into [] (map-indexed vector) [:a :b])"}
|
|
{:suite "transducers / into" :label "mapcat xform" :expected "[1 1 2 2]" :actual "(into [] (mapcat (fn [x] [x x])) [1 2])"}
|
|
{:suite "transducers / into" :label "cat xform" :expected "[1 2 3 4]" :actual "(into [] cat [[1 2] [3 4]])"}
|
|
{:suite "transducers / into" :label "into a set" :expected "#{4 3 2}" :actual "(into #{} (map inc) [1 2 3])"}
|
|
{:suite "transducers / compose" :label "comp map+filter" :expected "[2 4 6 8]" :actual "(into [] (comp (map (fn [x] (* x 2))) (filter even?)) [1 2 3 4])"}
|
|
{:suite "transducers / compose" :label "comp filter+map" :expected "[2 4]" :actual "(into [] (comp (filter odd?) (map inc)) [1 2 3 4])"}
|
|
{:suite "transducers / compose" :label "comp three" :expected "[2]" :actual "(into [] (comp (map inc) (filter even?) (take 1)) [1 2 3 4])"}
|
|
{:suite "transducers / transduce & sequence" :label "transduce sum" :expected "9" :actual "(transduce (map inc) + [1 2 3])"}
|
|
{:suite "transducers / transduce & sequence" :label "transduce init" :expected "19" :actual "(transduce (map inc) + 10 [1 2 3])"}
|
|
{:suite "transducers / transduce & sequence" :label "transduce filter" :expected "6" :actual "(transduce (filter even?) + [1 2 3 4])"}
|
|
{:suite "transducers / transduce & sequence" :label "sequence xform" :expected "[2 3 4]" :actual "(sequence (map inc) [1 2 3])"}
|
|
{:suite "transducers / transduce & sequence" :label "eduction" :expected "[2 3 4]" :actual "(into [] (eduction (map inc) [1 2 3]))"}
|
|
{:suite "transducers / transduce & sequence" :label "completing" :expected "9" :actual "(transduce (map inc) (completing +) 0 [1 2 3])"}
|
|
{:suite "transducers / halt-when" :label "halt returns the halting input" :expected "7" :actual "(transduce (halt-when (fn [x] (> x 5))) conj [1 2 7 3])"}
|
|
{:suite "transducers / halt-when" :label "no halt is a plain reduction" :expected "[1 2 3]" :actual "(transduce (halt-when (fn [x] (> x 5))) conj [1 2 3])"}
|
|
{:suite "transducers / halt-when" :label "retf combines acc and input" :expected "[[1 2] 7]" :actual "(transduce (halt-when (fn [x] (> x 5)) (fn [r i] [r i])) conj [1 2 7 3])"}
|
|
{:suite "transducers / halt-when" :label "halt-when through into" :expected "3" :actual "(into [] (halt-when odd?) [2 4 3 6])"}
|
|
{:suite "transducers / short-circuit over infinite seqs" :label "into take (range)" :expected "[0 1 2 3 4]" :actual "(into [] (take 5) (range))"}
|
|
{:suite "transducers / short-circuit over infinite seqs" :label "transduce take (range)" :expected "3" :actual "(transduce (take 3) + 0 (range))"}
|
|
{:suite "transducers / short-circuit over infinite seqs" :label "sequence take (range)" :expected "[0 1 2 3 4]" :actual "(sequence (take 5) (range))"}
|
|
{:suite "transducers / short-circuit over infinite seqs" :label "take-while over (range)" :expected "[0 1 2]" :actual "(into [] (take-while (fn [x] (< x 3))) (range))"}
|
|
{:suite "transducers / short-circuit over infinite seqs" :label "comp take over (range)" :expected "[1 3 5]" :actual "(into [] (comp (filter odd?) (take 3)) (range))"}
|
|
{:suite "transducers / short-circuit over infinite seqs" :label "into take iterate" :expected "[0 1 2 3 4]" :actual "(into [] (take 5) (iterate inc 0))"}
|
|
{:suite "reduce / honors reduced" :label "reduced short-circuits inf" :expected "105" :actual "(reduce (fn [a x] (if (> a 100) (reduced a) (+ a x))) 0 (range))"}
|
|
{:suite "reduce / honors reduced" :label "reduce take inf" :expected "10" :actual "(reduce + (take 5 (range)))"}
|
|
{:suite "reduce / honors reduced" :label "reduce no-init first elem" :expected "6" :actual "(reduce + [1 2 3])"}
|
|
{:suite "reduce / honors reduced" :label "reduce no-init single" :expected "42" :actual "(reduce + [42])"}
|
|
{:suite "reduce / honors reduced" :label "reduce empty calls f" :expected "0" :actual "(reduce + [])"}
|
|
{:suite "reduce / honors reduced" :label "reduce with-init" :expected "16" :actual "(reduce + 10 [1 2 3])"}
|
|
{:suite "reduce / honors reduced" :label "reduce reduced immediate" :expected ":x" :actual "(reduce (fn [a x] (reduced :x)) :init [1 2 3])"}
|
|
{:suite "transducers / into & eduction (overlay)" :label "into list prepends" :expected "[4 3 1 2]" :actual "(into (quote (1 2)) [3 4])"}
|
|
{:suite "transducers / into & eduction (overlay)" :label "into sorted-map" :expected "{1 :a, 2 :b}" :actual "(into (sorted-map) [[2 :b] [1 :a]])"}
|
|
{:suite "transducers / into & eduction (overlay)" :label "into from map entry" :expected "[:a 1]" :actual "(into [] (first {:a 1}))"}
|
|
{:suite "transducers / into & eduction (overlay)" :label "into xform on map" :expected "{:a 2}" :actual "(into {} (map (fn [e] [(key e) (inc (val e))])) {:a 1})"}
|
|
{:suite "transducers / into & eduction (overlay)" :label "eduction multiple xforms" :expected "[4]" :actual "(into [] (eduction (filter odd?) (map inc) [2 3 4]))"}
|
|
{:suite "transducers / into & eduction (overlay)" :label "->Eduction" :expected "[2 3]" :actual "(->Eduction (map inc) [1 2])"}
|
|
{:suite "transducers / into & eduction (overlay)" :label "transduce no init uses (f)" :expected "5" :actual "(transduce (map inc) + [1 2])"}
|
|
{:suite "transient / vector" :label "conj! then persistent!" :expected "[1 2]" :actual "(persistent! (conj! (conj! (transient []) 1) 2))"}
|
|
{:suite "transient / vector" :label "reduce conj!" :expected "[0 1 2 3 4]" :actual "(persistent! (reduce conj! (transient []) (range 5)))"}
|
|
{:suite "transient / vector" :label "conj! many args" :expected "[1 2 3]" :actual "(persistent! (conj! (transient [1]) 2 3))"}
|
|
{:suite "transient / vector" :label "assoc! existing" :expected "[1 9 3]" :actual "(persistent! (assoc! (transient [1 2 3]) 1 9))"}
|
|
{:suite "transient / vector" :label "assoc! at count grows" :expected "[1 2 3]" :actual "(persistent! (assoc! (transient [1 2]) 2 3))"}
|
|
{:suite "transient / vector" :label "pop!" :expected "[1 2]" :actual "(persistent! (pop! (transient [1 2 3])))"}
|
|
{:suite "transient / vector" :label "from existing vector" :expected "[1 2 3 4]" :actual "(persistent! (conj! (transient [1 2 3]) 4))"}
|
|
{:suite "transient / vector" :label "count" :expected "3" :actual "(count (transient [1 2 3]))"}
|
|
{:suite "transient / vector" :label "nth" :expected "2" :actual "(nth (transient [1 2 3]) 1)"}
|
|
{:suite "transient / vector" :label "get" :expected "2" :actual "(get (transient [1 2 3]) 1)"}
|
|
{:suite "transient / vector" :label "persistent! is a vector" :expected "true" :actual "(vector? (persistent! (transient [1])))"}
|
|
{:suite "transient / vector" :label "transient? true" :expected "true" :actual "(transient? (transient []))"}
|
|
{:suite "transient / vector" :label "transient? false" :expected "false" :actual "(transient? [1 2])"}
|
|
{:suite "transient / map" :label "assoc! then persistent!" :expected "{:a 1, :b 2}" :actual "(persistent! (assoc! (assoc! (transient {}) :a 1) :b 2))"}
|
|
{:suite "transient / map" :label "assoc! many" :expected "{:a 1, :b 2}" :actual "(persistent! (assoc! (transient {}) :a 1 :b 2))"}
|
|
{:suite "transient / map" :label "dissoc!" :expected "{:b 2}" :actual "(persistent! (dissoc! (transient {:a 1 :b 2}) :a))"}
|
|
{:suite "transient / map" :label "conj! map entry" :expected "{:a 1}" :actual "(persistent! (conj! (transient {}) [:a 1]))"}
|
|
{:suite "transient / map" :label "from existing map" :expected "{:a 1, :b 2}" :actual "(persistent! (assoc! (transient {:a 1}) :b 2))"}
|
|
{:suite "transient / map" :label "get" :expected "1" :actual "(get (transient {:a 1}) :a)"}
|
|
{:suite "transient / map" :label "get missing default" :expected ":x" :actual "(get (transient {:a 1}) :z :x)"}
|
|
{:suite "transient / map" :label "contains?" :expected "true" :actual "(contains? (transient {:a 1}) :a)"}
|
|
{:suite "transient / map" :label "count" :expected "2" :actual "(count (transient {:a 1 :b 2}))"}
|
|
{:suite "transient / map" :label "collection key by value" :expected ":v" :actual "(get (persistent! (assoc! (transient {}) [1 2] :v)) [1 2])"}
|
|
{:suite "transient / map" :label "persistent! is a map" :expected "true" :actual "(map? (persistent! (transient {:a 1})))"}
|
|
{:suite "transient / map" :label "reduce build" :expected "{0 0, 1 1, 2 2}" :actual "(persistent! (reduce (fn [t i] (assoc! t i i)) (transient {}) (range 3)))"}
|
|
{:suite "transient / set" :label "conj! dedups" :expected "#{1 2 3}" :actual "(persistent! (conj! (transient #{}) 1 2 2 3))"}
|
|
{:suite "transient / set" :label "disj!" :expected "#{1 3}" :actual "(persistent! (disj! (transient #{1 2 3}) 2))"}
|
|
{:suite "transient / set" :label "from existing set" :expected "#{1 3 2}" :actual "(persistent! (conj! (transient #{1 2}) 3))"}
|
|
{:suite "transient / set" :label "contains?" :expected "true" :actual "(contains? (transient #{1 2}) 1)"}
|
|
{:suite "transient / set" :label "count" :expected "2" :actual "(count (transient #{1 2}))"}
|
|
{:suite "transient / set" :label "persistent! is a set" :expected "true" :actual "(set? (persistent! (transient #{1})))"}
|
|
{:suite "transient / set" :label "map elements by value" :expected "1" :actual "(count (persistent! (conj! (transient #{}) {:a 1} (hash-map :a 1))))"}
|
|
{:suite "transient / immutability of source" :label "source vector unchanged" :expected "true" :actual "(let [v [1 2 3] _ (persistent! (conj! (transient v) 4))] (= v [1 2 3]))"}
|
|
{:suite "transient / immutability of source" :label "source map unchanged" :expected "true" :actual "(let [m {:a 1} _ (persistent! (assoc! (transient m) :b 2))] (= m {:a 1}))"}
|
|
{:suite "transient / invokable lookup" :label "vector index" :expected "20" :actual "((transient [10 20 30]) 1)"}
|
|
{:suite "transient / invokable lookup" :label "map key as fn" :expected "7" :actual "((transient {:x 7}) :x)"}
|
|
{:suite "transient / invokable lookup" :label "map key default" :expected "99" :actual "((transient {:x 7}) :z 99)"}
|
|
{:suite "transient / invokable lookup" :label "keyword on transient" :expected "7" :actual "(:x (transient {:x 7}))"}
|
|
{:suite "transient / invokable lookup" :label "set membership" :expected "2" :actual "((transient #{1 2 3}) 2)"}
|
|
{:suite "transient / invokable lookup" :label "set miss default" :expected ":no" :actual "((transient #{1 2 3}) 42 :no)"}
|
|
{:suite "transient / invokable lookup" :label "collection key" :expected ":v" :actual "((transient {[1 2] :v}) [1 2])"}
|
|
{:suite "transient / assoc! odd args throw" :label "map dangling key" :expected "{:a 1, :b nil}" :actual "(persistent! (assoc! (transient {}) :a 1 :b))"}
|
|
{:suite "transient / assoc! odd args throw" :label "map lone key" :expected :throws :actual "(persistent! (assoc! (transient {}) :a))"}
|
|
{:suite "transient / assoc! odd args throw" :label "vector dangling" :expected "[9 nil]" :actual "(persistent! (apply assoc! (transient []) [0 9 1]))"}
|
|
{:suite "transient / assoc! odd args throw" :label "even args still ok" :expected "true" :actual "(= {:a 1, :b 2} (persistent! (assoc! (transient {}) :a 1 :b 2)))"}
|
|
{:suite "transient / invalidation" :label "conj! after persistent!" :expected :throws :actual "(let [t (transient [])] (persistent! t) (conj! t 1))"}
|
|
{:suite "transient / invalidation" :label "assoc! after persistent!" :expected :throws :actual "(let [t (transient {})] (persistent! t) (assoc! t :a 1))"}
|
|
{:suite "transient / invalidation" :label "persistent! twice" :expected :throws :actual "(let [t (transient [])] (persistent! t) (persistent! t))"}
|
|
{:suite "transient / invalidation" :label "pop! empty" :expected :throws :actual "(pop! (transient []))"}
|
|
{:suite "transient / strictness" :label "conj! on persistent" :expected :throws :actual "(conj! [1 2] 3)"}
|
|
{:suite "transient / strictness" :label "assoc! on persistent" :expected :throws :actual "(assoc! {:a 1} :b 2)"}
|
|
{:suite "transient / strictness" :label "persistent! on vector" :expected :throws :actual "(persistent! [1 2])"}
|
|
{:suite "transient / strictness" :label "persistent! on nil" :expected :throws :actual "(persistent! nil)"}
|
|
{:suite "transient / strictness" :label "pop! on transient map" :expected :throws :actual "(pop! (transient {:a 1}))"}
|
|
{:suite "transient / strictness" :label "dissoc! on tset" :expected :throws :actual "(dissoc! (transient #{1}) 1)"}
|
|
{:suite "transient / strictness" :label "conj! map bad item" :expected :throws :actual "(conj! (transient {}) #{:a 1})"}
|
|
{:suite "transient / strictness" :label "conj! no args" :expected "[]" :actual "(persistent! (conj!))"}
|
|
{:suite "transient / strictness" :label "conj! identity" :expected "[1 2]" :actual "(conj! [1 2])"}
|
|
{:suite "transient / strictness" :label "conj! map merges map" :expected "{:a 1, :b 2}" :actual "(persistent! (conj! (transient {:a 1}) {:b 2}))"}
|
|
{:suite "transient / assoc! bounds" :label "assoc! existing idx" :expected "[1 9 3]" :actual "(persistent! (assoc! (transient [1 2 3]) 1 9))"}
|
|
{:suite "transient / assoc! bounds" :label "assoc! at count grows" :expected "[1 2 3]" :actual "(persistent! (assoc! (transient [1 2]) 2 3))"}
|
|
{:suite "transient / assoc! bounds" :label "assoc! out of bounds" :expected :throws :actual "(assoc! (transient [0 1 2]) 4 4)"}
|
|
{:suite "transient / assoc! bounds" :label "assoc! negative" :expected :throws :actual "(assoc! (transient []) -1 0)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "nil is falsy" :expected ":f" :actual "(if nil :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "false is falsy" :expected ":f" :actual "(if false :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "zero is truthy" :expected ":t" :actual "(if 0 :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "zero float truthy" :expected ":t" :actual "(if 0.0 :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "empty string truthy" :expected ":t" :actual "(if \"\" :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "empty list truthy" :expected ":t" :actual "(if (list) :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "empty vector truthy" :expected ":t" :actual "(if [] :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "empty map truthy" :expected ":t" :actual "(if {} :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "empty set truthy" :expected ":t" :actual "(if #{} :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "number truthy" :expected ":t" :actual "(if 42 :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "string truthy" :expected ":t" :actual "(if \"x\" :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "keyword truthy" :expected ":t" :actual "(if :kw :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "symbol truthy" :expected ":t" :actual "(if (quote abc) :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "coll truthy" :expected ":t" :actual "(if [1 2] :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "map truthy" :expected ":t" :actual "(if {:a 1} :t :f)"}
|
|
{:suite "truthiness / if (only nil & false are falsy)" :label "if no else -> nil" :expected "nil" :actual "(if false :t)"}
|
|
{:suite "truthiness / not" :label "not nil" :expected "true" :actual "(not nil)"}
|
|
{:suite "truthiness / not" :label "not false" :expected "true" :actual "(not false)"}
|
|
{:suite "truthiness / not" :label "not zero" :expected "false" :actual "(not 0)"}
|
|
{:suite "truthiness / not" :label "not empty vector" :expected "false" :actual "(not [])"}
|
|
{:suite "truthiness / not" :label "not empty string" :expected "false" :actual "(not \"\")"}
|
|
{:suite "truthiness / not" :label "not number" :expected "false" :actual "(not 42)"}
|
|
{:suite "truthiness / not" :label "not true" :expected "false" :actual "(not true)"}
|
|
{:suite "truthiness / and" :label "empty is true" :expected "true" :actual "(and)"}
|
|
{:suite "truthiness / and" :label "single value" :expected "5" :actual "(and 5)"}
|
|
{:suite "truthiness / and" :label "all truthy -> last" :expected "3" :actual "(and 1 2 3)"}
|
|
{:suite "truthiness / and" :label "stops at false" :expected "false" :actual "(and 1 false 3)"}
|
|
{:suite "truthiness / and" :label "stops at nil" :expected "nil" :actual "(and 1 nil 3)"}
|
|
{:suite "truthiness / and" :label "false alone" :expected "false" :actual "(and false)"}
|
|
{:suite "truthiness / and" :label "nil alone" :expected "nil" :actual "(and nil)"}
|
|
{:suite "truthiness / and" :label "zero is truthy" :expected "0" :actual "(and 1 0)"}
|
|
{:suite "truthiness / or" :label "empty is nil" :expected "nil" :actual "(or)"}
|
|
{:suite "truthiness / or" :label "first truthy" :expected "1" :actual "(or 1 2)"}
|
|
{:suite "truthiness / or" :label "skips nil/false" :expected "5" :actual "(or nil false 5)"}
|
|
{:suite "truthiness / or" :label "all falsy -> last" :expected "false" :actual "(or nil false)"}
|
|
{:suite "truthiness / or" :label "nil chain -> false" :expected "false" :actual "(or nil nil nil false)"}
|
|
{:suite "truthiness / or" :label "zero is truthy" :expected "0" :actual "(or 0 1)"}
|
|
{:suite "truthiness / or" :label "false alone" :expected "false" :actual "(or false)"}
|
|
{:suite "truthiness / if-not & boolean" :label "if-not false" :expected ":yes" :actual "(if-not false :yes :no)"}
|
|
{:suite "truthiness / if-not & boolean" :label "if-not truthy" :expected ":no" :actual "(if-not 0 :yes :no)"}
|
|
{:suite "truthiness / if-not & boolean" :label "when-not nil" :expected "1" :actual "(when-not nil 1)"}
|
|
{:suite "truthiness / if-not & boolean" :label "when-not truthy" :expected "nil" :actual "(when-not 5 1)"}
|
|
{:suite "truthiness / if-not & boolean" :label "boolean of nil" :expected "false" :actual "(boolean nil)"}
|
|
{:suite "truthiness / if-not & boolean" :label "boolean of false" :expected "false" :actual "(boolean false)"}
|
|
{:suite "truthiness / if-not & boolean" :label "boolean of 0" :expected "true" :actual "(boolean 0)"}
|
|
{:suite "truthiness / if-not & boolean" :label "boolean of value" :expected "true" :actual "(boolean :x)"}
|
|
{:suite "truthiness / if-not & boolean" :label "true?/false?" :expected "true" :actual "(and (true? true) (false? false) (not (true? 1)))"}
|
|
{:suite "untested / primed + division + bit ops" :label "+'" :expected "3" :actual "(+' 1 2)"}
|
|
{:suite "untested / primed + division + bit ops" :label "-'" :expected "3" :actual "(-' 5 2)"}
|
|
{:suite "untested / primed + division + bit ops" :label "*'" :expected "12" :actual "(*' 3 4)"}
|
|
{:suite "untested / primed + division + bit ops" :label "inc'" :expected "2.5" :actual "(inc' 1.5)"}
|
|
{:suite "untested / primed + division + bit ops" :label "dec'" :expected "1.5" :actual "(dec' 2.5)"}
|
|
{:suite "untested / primed + division + bit ops" :label "/" :expected "2" :actual "(/ 6 3)"}
|
|
{:suite "untested / primed + division + bit ops" :label "/ ratio-as-double" :expected "1/2" :actual "(/ 1 2)"}
|
|
{:suite "untested / primed + division + bit ops" :label "bit-not" :expected "-6" :actual "(bit-not 5)"}
|
|
{:suite "untested / primed + division + bit ops" :label "bit-and-not" :expected "4" :actual "(bit-and-not 12 10)"}
|
|
{:suite "untested / primed + division + bit ops" :label "bit-flip" :expected "3" :actual "(bit-flip 2 0)"}
|
|
{:suite "untested / primed + division + bit ops" :label "unsigned-bit-shift-right" :expected "2" :actual "(unsigned-bit-shift-right 8 2)"}
|
|
{:suite "untested / hash family" :label "hash stable" :expected "true" :actual "(= (hash :a) (hash :a))"}
|
|
{:suite "untested / hash family" :label "hash int" :expected "true" :actual "(int? (hash [1 2]))"}
|
|
{:suite "untested / hash family" :label "hash-combine" :expected "true" :actual "(int? (hash-combine 1 2))"}
|
|
{:suite "untested / hash family" :label "hash-ordered-coll" :expected "true" :actual "(int? (hash-ordered-coll [1 2]))"}
|
|
{:suite "untested / hash family" :label "hash-unordered-coll" :expected "true" :actual "(int? (hash-unordered-coll #{1}))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "make-array" :expected "[nil nil nil]" :actual "(vec (make-array Object 3))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "into-array" :expected "[1 2]" :actual "(vec (into-array [1 2]))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "to-array" :expected "[1 2]" :actual "(vec (to-array [1 2]))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aclone vec" :expected "[1 2]" :actual "(vec (aclone (int-array [1 2])))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aclone independent" :expected "[9 2]" :actual "(let [a (aclone (to-array [1 2]))] (aset a 0 9) (seq a))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset/aget" :expected "9" :actual "(let [a (to-array [1 2 3])] (aset a 0 9) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset-int" :expected "7" :actual "(let [a (to-array [1 2])] (aset-int a 0 7) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset-boolean" :expected "true" :actual "(let [a (to-array [1])] (aset-boolean a 0 true) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset-byte" :expected "9" :actual "(let [a (to-array [0])] (aset-byte a 0 9) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset-char" :expected "\\a" :actual "(let [a (to-array [0])] (aset-char a 0 \\a) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset-double" :expected "1.5" :actual "(let [a (to-array [0])] (aset-double a 0 1.5) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset-float" :expected "2.5" :actual "(let [a (to-array [0])] (aset-float a 0 2.5) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset-long" :expected "3" :actual "(let [a (to-array [0])] (aset-long a 0 3) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "aset-short" :expected "4" :actual "(let [a (to-array [0])] (aset-short a 0 4) (aget a 0))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "boolean-array" :expected "[false false]" :actual "(vec (boolean-array 2))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "int-array" :expected "[1 2]" :actual "(vec (int-array [1 2]))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "long-array" :expected "[0 0]" :actual "(vec (long-array 2))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "double-array" :expected "[0.0 0.0]" :actual "(vec (double-array 2))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "float-array" :expected "[0.0 0.0]" :actual "(vec (float-array 2))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "short-array" :expected "[0 0]" :actual "(vec (short-array 2))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "char-array count" :expected "2" :actual "(count (char-array 2))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "byte-array bytes?" :expected "true" :actual "(bytes? (byte-array 2))"}
|
|
{:suite "untested / array stubs (vectors + host buffers)" :label "bytes? not vec" :expected "false" :actual "(bytes? [1])"}
|
|
{:suite "untested / typed coercion views" :label "booleans" :expected "(quote (true))" :actual "(booleans [true])"}
|
|
{:suite "untested / typed coercion views" :label "doubles" :expected "[1.0]" :actual "(vec (doubles (double-array [1.0])))"}
|
|
{:suite "untested / typed coercion views" :label "floats" :expected "[1.0]" :actual "(vec (floats (float-array [1.0])))"}
|
|
{:suite "untested / typed coercion views" :label "ints" :expected "(quote (1))" :actual "(ints [1])"}
|
|
{:suite "untested / typed coercion views" :label "longs" :expected "(quote (1))" :actual "(longs [1])"}
|
|
{:suite "untested / typed coercion views" :label "shorts" :expected "(quote (1))" :actual "(shorts [1])"}
|
|
{:suite "untested / typed coercion views" :label "chars first" :expected "\\a" :actual "(first (chars [\\a]))"}
|
|
{:suite "untested / typed coercion views" :label "bytes view" :expected "true" :actual "(bytes? (bytes [65]))"}
|
|
{:suite "untested / typed coercion views" :label "byte" :expected "65" :actual "(byte 65)"}
|
|
{:suite "untested / typed coercion views" :label "short" :expected "1" :actual "(short 1)"}
|
|
{:suite "untested / typed coercion views" :label "long truncates" :expected "1" :actual "(long 1.7)"}
|
|
{:suite "untested / typed coercion views" :label "double" :expected "3.0" :actual "(double 3)"}
|
|
{:suite "untested / typed coercion views" :label "float" :expected "3.0" :actual "(float 3)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-add" :expected "3" :actual "(unchecked-add 1 2)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-add-int" :expected "3" :actual "(unchecked-add-int 1 2)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-subtract" :expected "3" :actual "(unchecked-subtract 5 2)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-subtract-int" :expected "3" :actual "(unchecked-subtract-int 5 2)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-multiply" :expected "6" :actual "(unchecked-multiply 2 3)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-multiply-int" :expected "6" :actual "(unchecked-multiply-int 2 3)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-inc" :expected "2" :actual "(unchecked-inc 1)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-inc-int" :expected "2" :actual "(unchecked-inc-int 1)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-dec" :expected "2" :actual "(unchecked-dec 3)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-dec-int" :expected "2" :actual "(unchecked-dec-int 3)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-negate" :expected "-4" :actual "(unchecked-negate 4)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-negate-int" :expected "-4" :actual "(unchecked-negate-int 4)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-divide-int" :expected "3" :actual "(unchecked-divide-int 7 2)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-remainder-int" :expected "1" :actual "(unchecked-remainder-int 7 2)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-int" :expected "3" :actual "(unchecked-int 3.7)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-long" :expected "3" :actual "(unchecked-long 3.7)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-double" :expected "3.0" :actual "(unchecked-double 3)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-float" :expected "3.0" :actual "(unchecked-float 3)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-byte" :expected "65" :actual "(unchecked-byte 65)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-char" :expected "\\a" :actual "(unchecked-char 97)"}
|
|
{:suite "untested / unchecked-* are plain ops" :label "unchecked-short" :expected "5" :actual "(unchecked-short 5)"}
|
|
{:suite "untested / chunk family (eager equivalents) + cat" :label "chunk round-trip" :expected "1" :actual "(let [cb (chunk-buffer 4)] (chunk-append cb 1) (chunk-first (chunk-cons (chunk cb) nil)))"}
|
|
{:suite "untested / chunk family (eager equivalents) + cat" :label "cat transducer" :expected "[1 2 3]" :actual "(into [] cat [[1] [2 3]])"}
|
|
{:suite "untested / chunk family (eager equivalents) + cat" :label "ensure-reduced wraps" :expected "true" :actual "(reduced? (ensure-reduced 5))"}
|
|
{:suite "untested / chunk family (eager equivalents) + cat" :label "ensure-reduced keeps reduced" :expected "true" :actual "(reduced? (ensure-reduced (reduced 5)))"}
|
|
{:suite "untested / chunk family (eager equivalents) + cat" :label "halt-when" :expected "4" :actual "(transduce (halt-when even?) conj [] [1 3 4 5])"}
|
|
{:suite "untested / chunk family (eager equivalents) + cat" :label "chunk-next exhausted" :expected "nil" :actual "(let [cb (chunk-buffer 2)] (chunk-append cb 1) (chunk-next (chunk-cons (chunk cb) nil)))"}
|
|
{:suite "untested / chunk family (eager equivalents) + cat" :label "chunk-rest seqable" :expected "[]" :actual "(let [cb (chunk-buffer 2)] (chunk-append cb 1) (vec (chunk-rest (chunk-cons (chunk cb) nil))))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "class number" :expected "java.lang.Long" :actual "(class 1)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "class string" :expected "java.lang.String" :actual "(class \"s\")"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "class keyword" :expected "clojure.lang.Keyword" :actual "(class :k)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "class nil" :expected "nil" :actual "(class nil)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "bean is the map" :expected "{:a 1}" :actual "(bean {:a 1})"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "biginteger" :expected "\"5\"" :actual "(str (biginteger 5))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "proxy resolves nil" :expected "nil" :actual "(proxy [Object] [] (toString [] \"x\"))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "construct-proxy throws" :expected :throws :actual "(construct-proxy nil)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "get-proxy-class throws" :expected :throws :actual "(get-proxy-class)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "init-proxy" :expected "nil" :actual "(init-proxy nil {})"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "update-proxy" :expected "nil" :actual "(update-proxy nil {})"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "proxy-mappings" :expected "{}" :actual "(proxy-mappings nil)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "proxy-call-with-super calls" :expected "1" :actual "(proxy-call-with-super (fn [] 1) nil \"m\")"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "memfn upper" :expected "\"ABC\"" :actual "((memfn toUpperCase) \"abc\")"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "memfn with args" :expected "2" :actual "((memfn indexOf needle) \"hello\" \"l\")"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "memfn length" :expected "3" :actual "((memfn length) \"abc\")"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "array-seq" :expected "(quote (1 2 3))" :actual "(array-seq (to-array [1 2 3]))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "array-seq empty" :expected "nil" :actual "(array-seq (to-array []))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "proxy-super throws" :expected :throws :actual "(proxy-super count [1])"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "re-groups throws" :expected :throws :actual "(re-groups (re-matcher #\"a\" \"b\"))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "re-matcher builds" :expected "false" :actual "(nil? (re-matcher #\"a\" \"abc\"))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "print-dup nil writer throws" :expected :throws :actual "(print-dup 1 nil)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "print-method nil writer throws" :expected :throws :actual "(print-method 1 nil)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "uri? string" :expected "false" :actual "(uri? \"http://x\")"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "uri? nil" :expected "false" :actual "(uri? nil)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "definterface defines" :expected "false" :actual "(var? (definterface IFoo (foo [x])))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "enumeration-seq" :expected "(quote (1 2))" :actual "(enumeration-seq [1 2])"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "iterator-seq" :expected "(quote (1 2))" :actual "(iterator-seq [1 2])"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "seque passthrough" :expected "[1 2]" :actual "(seque [1 2])"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "delay? true" :expected "true" :actual "(delay? (delay 1))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "delay? false" :expected "false" :actual "(delay? 1)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "future-call" :expected "42" :actual "(deref (future-call (fn [] 42)))"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label ". calls String surface" :expected "3" :actual "(. \"abc\" length)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label ".. threads members" :expected "\"ABC\"" :actual "(.. \"abc\" toUpperCase)"}
|
|
{:suite "untested / JVM-shape stubs (documented jolt behavior)" :label "unknown String member throws" :expected :throws :actual "(. \"abc\" frobnicate)"}
|
|
{:suite "untested / protocols: extend + extends?" :label "extend registers" :expected ":str" :actual "(do (defprotocol Pe (pe [x])) (extend (quote String) Pe {:pe (fn [x] :str)}) (pe \"s\"))"}
|
|
{:suite "untested / protocols: extend + extends?" :label "extend two methods" :expected "[1 2]" :actual "(do (defprotocol P3 (pa [x]) (pb [x])) (extend (quote Long) P3 {:pa (fn [x] 1) :pb (fn [x] 2)}) [(pa 0) (pb 0)])"}
|
|
{:suite "untested / protocols: extend + extends?" :label "extends? after extend" :expected "true" :actual "(do (defprotocol P4 (pc [x])) (extend (quote Long) P4 {:pc (fn [x] 1)}) (extends? P4 (quote Long)))"}
|
|
{:suite "untested / protocols: extend + extends?" :label "extends? without" :expected "false" :actual "(do (defprotocol P5 (pd [x])) (extends? P5 (quote Long)))"}
|
|
{:suite "untested / ns + REPL machinery" :label "all-ns non-empty" :expected "true" :actual "(pos? (count (all-ns)))"}
|
|
{:suite "untested / ns + REPL machinery" :label "ns-interns sees def" :expected "true" :actual "(do (def zz 1) (pos? (count (ns-interns (quote user)))))"}
|
|
{:suite "untested / ns + REPL machinery" :label "ns-interns countable" :expected "true" :actual "(map? (ns-interns (quote user)))"}
|
|
{:suite "untested / ns + REPL machinery" :label "ns-imports empty user" :expected "96" :actual "(count (ns-imports (quote user)))"}
|
|
{:suite "untested / ns + REPL machinery" :label "reset-meta!" :expected "{:doc \"d\"}" :actual "(do (def vv 1) (reset-meta! (var vv) {:doc \"d\"}))"}
|
|
{:suite "untested / ns + REPL machinery" :label "prefers empty" :expected "{}" :actual "(do (defmulti mm identity) (prefers mm))"}
|
|
{:suite "untested / ns + REPL machinery" :label "refer-clojure" :expected "nil" :actual "(refer-clojure)"}
|
|
{:suite "untested / ns + REPL machinery" :label "special-symbol? if" :expected "true" :actual "(special-symbol? (quote if))"}
|
|
{:suite "untested / ns + REPL machinery" :label "special-symbol? fn name" :expected "false" :actual "(special-symbol? (quote foo))"}
|
|
{:suite "untested / ns + REPL machinery" :label "destructure expands" :expected "true" :actual "(pos? (count (destructure (quote [[a b] x]))))"}
|
|
{:suite "untested / ns + REPL machinery" :label "seq-to-map-for-destructuring" :expected "{:a 1}" :actual "(seq-to-map-for-destructuring (quote (:a 1)))"}
|
|
{:suite "untested / ns + REPL machinery" :label "s2m trailing map passes through" :expected "{:b 2}" :actual "(seq-to-map-for-destructuring (list {:b 2}))"}
|
|
{:suite "untested / ns + REPL machinery" :label "s2m unpaired key throws" :expected :throws :actual "(seq-to-map-for-destructuring (quote (:a 1 :b)))"}
|
|
{:suite "untested / ns + REPL machinery" :label "s2m kwargs trailing map call" :expected "2" :actual "((fn [& {:keys [b]}] b) {:b 2})"}
|
|
{:suite "untested / ns + REPL machinery" :label "*clojure-version* major" :expected "1" :actual "(:major *clojure-version*)"}
|
|
{:suite "untested / ns + REPL machinery" :label "*ns* user" :expected "\"user\"" :actual "(str *ns*)"}
|
|
{:suite "untested / ns + REPL machinery" :label "*1 nil outside repl" :expected "nil" :actual "*1"}
|
|
{:suite "untested / ns + REPL machinery" :label "*2 nil" :expected "nil" :actual "*2"}
|
|
{:suite "untested / ns + REPL machinery" :label "*3 nil" :expected "nil" :actual "*3"}
|
|
{:suite "untested / ns + REPL machinery" :label "*e nil" :expected "nil" :actual "*e"}
|
|
{:suite "untested / ns + REPL machinery" :label "*unchecked-math*" :expected "false" :actual "*unchecked-math*"}
|
|
{:suite "untested / ns + REPL machinery" :label "*in* bound" :expected "false" :actual "(map? *in*)"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "nfirst" :expected "[2]" :actual "(nfirst [[1 2] [3]])"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "xml-seq root" :expected "1" :actual "(count (xml-seq {:tag :a :content []}))"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "xml-seq walks" :expected "2" :actual "(count (xml-seq {:tag :a :content [{:tag :b :content []}]}))"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "comp keyword stage" :expected "[1 2]" :actual "((comp seq :content) {:content [1 2]})"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "comp three stages" :expected "4" :actual "((comp inc inc :n) {:n 2})"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "random-sample all" :expected "[1 2]" :actual "(random-sample 1.0 [1 2])"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "random-sample none" :expected "[]" :actual "(random-sample 0.0 [1 2])"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "reader-conditional builds" :expected "true" :actual "(reader-conditional? (reader-conditional (quote (:clj 1)) false))"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "->Eduction" :expected "[2 3]" :actual "(vec (->Eduction (map inc) [1 2]))"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "bound-fn calls" :expected "42" :actual "((bound-fn [] 42))"}
|
|
{:suite "untested / misc seqs + binding machinery" :label "push/pop-thread-bindings" :expected ":ok" :actual "(do (push-thread-bindings {}) (pop-thread-bindings) :ok)"}
|
|
{:suite "uuid / random-uuid" :label "returns a uuid" :expected "true" :actual "(uuid? (random-uuid))"}
|
|
{:suite "uuid / random-uuid" :label "str is 36 chars" :expected "36" :actual "(count (str (random-uuid)))"}
|
|
{:suite "uuid / random-uuid" :label "8-4-4-4-12 shape" :expected "[8 4 4 4 12]" :actual "(do (require (quote [clojure.string :as s])) (mapv count (s/split (str (random-uuid)) #\"-\")))"}
|
|
{:suite "uuid / random-uuid" :label "version nibble is 4" :expected "\\4" :actual "(nth (str (random-uuid)) 14)"}
|
|
{:suite "uuid / random-uuid" :label "variant nibble 8-b" :expected "true" :actual "(contains? #{\\8 \\9 \\a \\b} (nth (seq (str (random-uuid))) 19))"}
|
|
{:suite "uuid / random-uuid" :label "distinct" :expected "10" :actual "(count (set (repeatedly 10 random-uuid)))"}
|
|
{:suite "uuid / random-uuid" :label "all hex digits" :expected "true" :actual "(every? (fn [c] (contains? (set (seq \"0123456789abcdef-\")) c)) (seq (str (random-uuid))))"}
|
|
{:suite "uuid / parse-uuid" :label "valid round-trips" :expected "\"b6883c0a-0342-4007-9966-bc2dfa6b109e\"" :actual "(str (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\"))"}
|
|
{:suite "uuid / parse-uuid" :label "parses to uuid" :expected "true" :actual "(uuid? (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\"))"}
|
|
{:suite "uuid / parse-uuid" :label "case-insensitive =" :expected "true" :actual "(= (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\") (parse-uuid \"B6883C0A-0342-4007-9966-BC2DFA6B109E\"))"}
|
|
{:suite "uuid / parse-uuid" :label "empty -> nil" :expected "nil" :actual "(parse-uuid \"\")"}
|
|
{:suite "uuid / parse-uuid" :label "short -> nil" :expected "nil" :actual "(parse-uuid \"0\")"}
|
|
{:suite "uuid / parse-uuid" :label "garbage -> nil" :expected "nil" :actual "(parse-uuid \"df0993\")"}
|
|
{:suite "uuid / parse-uuid" :label "too long -> nil" :expected "nil" :actual "(parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109eb\")"}
|
|
{:suite "uuid / parse-uuid" :label "leading extra -> nil" :expected "nil" :actual "(parse-uuid \"ab6883c0a-0342-4007-9966-bc2dfa6b109e\")"}
|
|
{:suite "uuid / parse-uuid" :label "non-hex -> nil" :expected "nil" :actual "(parse-uuid \"g6883c0a-0342-4007-9966-bc2dfa6b109e\")"}
|
|
{:suite "uuid / parse-uuid" :label "bad dashes -> nil" :expected "nil" :actual "(parse-uuid \"b6883c0a00342-4007-9966-bc2dfa6b109e\")"}
|
|
{:suite "uuid / parse-uuid" :label "non-string throws" :expected :throws :actual "(parse-uuid 1000)"}
|
|
{:suite "uuid / parse-uuid" :label "keyword throws" :expected :throws :actual "(parse-uuid :key)"}
|
|
{:suite "uuid / parse-uuid" :label "map throws" :expected :throws :actual "(parse-uuid {})"}
|
|
{:suite "uuid / value semantics" :label "equal by value" :expected "true" :actual "(= (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\") (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\"))"}
|
|
{:suite "uuid / value semantics" :label "unequal differs" :expected "false" :actual "(= (random-uuid) (random-uuid))"}
|
|
{:suite "uuid / value semantics" :label "works as map key" :expected ":v" :actual "(let [u (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\")] (get {u :v} (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\")))"}
|
|
{:suite "uuid / value semantics" :label "works in a set" :expected "true" :actual "(contains? #{(parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\")} (parse-uuid \"B6883C0A-0342-4007-9966-BC2DFA6B109E\"))"}
|
|
{:suite "uuid / value semantics" :label "uuid? false on string" :expected "false" :actual "(uuid? \"b6883c0a-0342-4007-9966-bc2dfa6b109e\")"}
|
|
{:suite "uuid / value semantics" :label "uuid? false on nil" :expected "false" :actual "(uuid? nil)"}
|
|
{:suite "uuid / #uuid reader literal" :label "reads to uuid" :expected "true" :actual "(uuid? #uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\")"}
|
|
{:suite "uuid / #uuid reader literal" :label "= parse-uuid" :expected "true" :actual "(= #uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\" (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\"))"}
|
|
{:suite "uuid / #uuid reader literal" :label "str of literal" :expected "\"b6883c0a-0342-4007-9966-bc2dfa6b109e\"" :actual "(str #uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\")"}
|
|
{:suite "uuid / #uuid reader literal" :label "pr-str round-trips" :expected "\"#uuid \\\"b6883c0a-0342-4007-9966-bc2dfa6b109e\\\"\"" :actual "(pr-str #uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\")"}
|
|
{:suite "vector / construct & predicate" :label "literal" :expected "[1 2 3]" :actual "[1 2 3]"}
|
|
{:suite "vector / construct & predicate" :label "vector" :expected "[1 2 3]" :actual "(vector 1 2 3)"}
|
|
{:suite "vector / construct & predicate" :label "vector zero args" :expected "[]" :actual "(vector)"}
|
|
{:suite "vector / construct & predicate" :label "vec from list" :expected "[1 2 3]" :actual "(vec (list 1 2 3))"}
|
|
{:suite "vector / construct & predicate" :label "vec from range" :expected "[0 1 2]" :actual "(vec (range 3))"}
|
|
{:suite "vector / construct & predicate" :label "vec of map yields entries" :expected "[[:a 1]]" :actual "(vec {:a 1})"}
|
|
{:suite "vector / construct & predicate" :label "vector? true" :expected "true" :actual "(vector? [1])"}
|
|
{:suite "vector / construct & predicate" :label "vector? false on list" :expected "false" :actual "(vector? (list 1))"}
|
|
{:suite "vector / construct & predicate" :label "vector = list elts" :expected "true" :actual "(= [1 2 3] (list 1 2 3))"}
|
|
{:suite "vector / access" :label "nth" :expected ":b" :actual "(nth [:a :b :c] 1)"}
|
|
{:suite "vector / access" :label "nth default" :expected ":x" :actual "(nth [:a] 5 :x)"}
|
|
{:suite "vector / access" :label "get by index" :expected ":b" :actual "(get [:a :b] 1)"}
|
|
{:suite "vector / access" :label "get out of range nil" :expected "nil" :actual "(get [:a] 5)"}
|
|
{:suite "vector / access" :label "get default" :expected ":x" :actual "(get [:a] 5 :x)"}
|
|
{:suite "vector / access" :label "first" :expected "1" :actual "(first [1 2 3])"}
|
|
{:suite "vector / access" :label "last" :expected "3" :actual "(last [1 2 3])"}
|
|
{:suite "vector / access" :label "peek is last" :expected "3" :actual "(peek [1 2 3])"}
|
|
{:suite "vector / access" :label "count" :expected "3" :actual "(count [1 2 3])"}
|
|
{:suite "vector / access" :label "contains? index" :expected "true" :actual "(contains? [:a :b] 1)"}
|
|
{:suite "vector / access" :label "contains? past end" :expected "false" :actual "(contains? [:a] 3)"}
|
|
{:suite "vector / access" :label "vector as fn" :expected ":b" :actual "([:a :b :c] 1)"}
|
|
{:suite "vector / access" :label "vector-in-local as fn" :expected "20" :actual "(let [v [10 20 30]] (v 1))"}
|
|
{:suite "vector / access" :label "keyword-in-local as fn" :expected "7" :actual "(let [k :a] (k {:a 7}))"}
|
|
{:suite "vector / access" :label "meta vector as fn" :expected "10" :actual "((with-meta [10 20] {:k 1}) 0)"}
|
|
{:suite "vector / update (persistent)" :label "conj appends" :expected "[1 2 3]" :actual "(conj [1 2] 3)"}
|
|
{:suite "vector / update (persistent)" :label "conj many" :expected "[1 2 3 4]" :actual "(conj [1 2] 3 4)"}
|
|
{:suite "vector / update (persistent)" :label "assoc index" :expected "[1 9 3]" :actual "(assoc [1 2 3] 1 9)"}
|
|
{:suite "vector / update (persistent)" :label "assoc at count appends" :expected "[1 2 3]" :actual "(assoc [1 2] 2 3)"}
|
|
{:suite "vector / update (persistent)" :label "update" :expected "[1 3 3]" :actual "(update [1 2 3] 1 inc)"}
|
|
{:suite "vector / update (persistent)" :label "pop drops last" :expected "[1 2]" :actual "(pop [1 2 3])"}
|
|
{:suite "vector / update (persistent)" :label "subvec start end" :expected "[2 3]" :actual "(subvec [1 2 3 4] 1 3)"}
|
|
{:suite "vector / update (persistent)" :label "subvec to end" :expected "[3 4]" :actual "(subvec [1 2 3 4] 2)"}
|
|
{:suite "vector / update (persistent)" :label "mapv" :expected "[2 3 4]" :actual "(mapv inc [1 2 3])"}
|
|
{:suite "vector / update (persistent)" :label "filterv" :expected "[2 4]" :actual "(filterv even? [1 2 3 4])"}
|
|
{:suite "vector / immutability & nesting" :label "conj does not mutate" :expected "true" :actual "(let [v [1 2] w (conj v 3)] (and (= v [1 2]) (= w [1 2 3])))"}
|
|
{:suite "vector / immutability & nesting" :label "assoc does not mutate" :expected "true" :actual "(let [v [1 2 3] w (assoc v 0 9)] (and (= v [1 2 3]) (= w [9 2 3])))"}
|
|
{:suite "vector / immutability & nesting" :label "get-in" :expected "2" :actual "(get-in [[1 2] [3 4]] [0 1])"}
|
|
{:suite "vector / immutability & nesting" :label "assoc-in" :expected "[[1 9]]" :actual "(assoc-in [[1 2]] [0 1] 9)"}
|
|
{:suite "vector / immutability & nesting" :label "update-in" :expected "[[1 3]]" :actual "(update-in [[1 2]] [0 1] inc)"}
|
|
{:suite "vector / immutability & nesting" :label "large vector nth" :expected "1500" :actual "(nth (vec (range 2000)) 1500)"}
|
|
{:suite "vector / immutability & nesting" :label "large vector count" :expected "2000" :actual "(count (vec (range 2000)))"}
|
|
{:suite "vector / immutability & nesting" :label "large conj immutable" :expected "true" :actual "(let [v (vec (range 1000)) w (conj v :end)] (and (= 1000 (count v)) (= 1001 (count w))))"}
|
|
{:suite "vector / bulk build boundaries" :label "count at 1025" :expected "1025" :actual "(count (vec (range 1025)))"}
|
|
{:suite "vector / bulk build boundaries" :label "into = vec at 1025" :expected "true" :actual "(= (vec (range 1025)) (into [] (range 1025)))"}
|
|
{:suite "vector / bulk build boundaries" :label "nth at leaf boundary" :expected "32" :actual "(nth (vec (range 1025)) 32)"}
|
|
{:suite "vector / bulk build boundaries" :label "nth at root boundary" :expected "1024" :actual "(nth (vec (range 1025)) 1024)"}
|
|
{:suite "vector / bulk build boundaries" :label "vec=into at 33" :expected "true" :actual "(= (vec (range 33)) (into [] (range 33)))"}
|
|
{:suite "vector / bulk build boundaries" :label "conj after bulk 1024" :expected "1025" :actual "(count (conj (vec (range 1024)) :x))"}
|
|
{:suite "vector / bulk build boundaries" :label "conj-after reads back" :expected ":x" :actual "(nth (conj (vec (range 1024)) :x) 1024)"}
|
|
{:suite "vector / bulk build boundaries" :label "assoc into bulk vec" :expected "9" :actual "(nth (assoc (vec (range 1025)) 1000 9) 1000)"}
|
|
{:suite "vector / bulk build boundaries" :label "into onto non-empty" :expected "[0 1 2 0 1]" :actual "(into (vec (range 3)) (range 2))"}
|
|
{:suite "clojure.walk / lists + seqs" :label "postwalk-replace symbol keys in a list" :expected "(quote (+ 2 2))" :actual "(do (require (quote [clojure.walk :as w])) (w/postwalk-replace {(quote x) 2} (quote (+ x x))))"}
|
|
{:suite "clojure.walk / lists + seqs" :label "postwalk descends a list" :expected "[:a :a]" :actual "(do (require (quote [clojure.walk :as w])) (w/postwalk (fn [n] (if (symbol? n) :a n)) (quote (x y))))"}
|
|
{:suite "clojure.walk / lists + seqs" :label "prewalk-replace in a list" :expected "(quote (* 3 3))" :actual "(do (require (quote [clojure.walk :as w])) (w/prewalk-replace {(quote *) (quote *) (quote y) 3} (quote (* y y))))"}
|
|
{:suite "clojure.walk / lists + seqs" :label "nested list + vector" :expected "[1 [2 1]]" :actual "(do (require (quote [clojure.walk :as w])) (w/postwalk-replace {:a 1 :b 2} (quote (:a [:b :a]))))"}
|
|
{:suite "clojure.walk / lists + seqs" :label "postwalk-replace in a vector" :expected "[:one 2 :one]" :actual "(do (require (quote [clojure.walk :as w])) (w/postwalk-replace {1 :one} [1 2 1]))"}
|
|
{:suite "clojure.walk / lists + seqs" :label "keywordize-keys still works" :expected "{:a 1}" :actual "(do (require (quote [clojure.walk :as w])) (w/keywordize-keys {\"a\" 1}))"}
|
|
{:suite "clojure.walk / lists + seqs" :label "apply-template substitutes" :expected "(quote (+ 1 2))" :actual "(do (require (quote [clojure.template :as t])) (t/apply-template (quote [x y]) (quote (+ x y)) (quote (1 2))))"}
|
|
{:suite "clojure.walk / records keep their type" :label "postwalk preserves record type" :expected "true" :actual "(do (require (quote [clojure.walk :as w])) (defrecord R [a]) (record? (w/postwalk identity (->R 1))))"}
|
|
{:suite "clojure.walk / records keep their type" :label "postwalk still walks record fields" :expected "2" :actual "(do (require (quote [clojure.walk :as w])) (defrecord R [a]) (:a (w/postwalk (fn [x] (if (number? x) (inc x) x)) (->R 1))))"}
|
|
{:suite "clojure.walk / records keep their type" :label "instance? survives a walk" :expected "true" :actual "(do (require (quote [clojure.walk :as w])) (defrecord R [a]) (instance? R (w/postwalk identity (->R 1))))"}
|
|
{:suite "clojure.walk / records keep their type" :label "a record nested in a map keeps its type" :expected "true" :actual "(do (require (quote [clojure.walk :as w])) (defrecord R [a]) (record? (:r (w/postwalk identity {:r (->R 1)}))))"}
|
|
{:suite "clojure.walk / records keep their type" :label "prewalk preserves record type" :expected "true" :actual "(do (require (quote [clojure.walk :as w])) (defrecord R [a]) (record? (w/prewalk identity (->R 1))))"}
|
|
{:suite "reader / auto-resolved keywords" :label "::kw is namespace-qualified" :expected "true" :actual "(some? (namespace ::foo))"}
|
|
{:suite "reader / auto-resolved keywords" :label "::kw keeps its name" :expected "\"foo\"" :actual "(name ::foo)"}
|
|
{:suite "reader / auto-resolved keywords" :label "::kw resolves to the current ns" :expected "true" :actual "(= ::a ::a)"}
|
|
{:suite "clojure.edn / reader opts" :label ":default receives the tag as a symbol" :expected "[true \"foo\" 5]" :actual "(do (require (quote [clojure.edn :as edn])) (let [r (edn/read-string {:default (fn [t v] [t v])} \"#foo 5\")] [(symbol? (first r)) (name (first r)) (second r)]))"}
|
|
{:suite "metadata / lazy seqs carry meta" :label "with-meta on a lazy seq" :expected "{:k 1}" :actual "(meta (with-meta (map inc [1 2 3]) {:k 1}))"}
|
|
{:suite "dynamic vars / *print-meta*" :label "*print-meta* is a bindable dynamic var" :expected "true" :actual "(binding [*print-meta* true] (true? *print-meta*))"}
|
|
{:suite "tagged literals / value equality" :label "equal tag+form are =" :expected "true" :actual "(= (tagged-literal (quote x) [1 2]) (tagged-literal (quote x) [1 2]))"}
|
|
{:suite "tagged literals / value equality" :label "different tag is not =" :expected "false" :actual "(= (tagged-literal (quote x) [1]) (tagged-literal (quote y) [1]))"}
|
|
{:suite "tagged literals / value equality" :label "dedup as map keys" :expected "1" :actual "(count {(tagged-literal (quote x) [1]) :a (tagged-literal (quote x) [1]) :b})"}
|
|
{:suite "interop / clojure.lang interfaces" :label "vector is IObj" :expected "true" :actual "(instance? clojure.lang.IObj [1])"}
|
|
{:suite "interop / clojure.lang interfaces" :label "map entry is IMapEntry" :expected "true" :actual "(instance? clojure.lang.IMapEntry (first {:a 1}))"}
|
|
{:suite "interop / clojure.lang interfaces" :label "record is IRecord" :expected "true" :actual "(do (defrecord R [a]) (instance? clojure.lang.IRecord (->R 1)))"}
|
|
{:suite "interop / clojure.lang interfaces" :label "number is not IObj" :expected "false" :actual "(instance? clojure.lang.IObj 5)"}
|
|
{:suite "reader / default data readers" :label "#inst is in default-data-readers" :expected "true" :actual "(boolean (get default-data-readers (quote inst)))"}
|
|
{:suite "conformance / CRITICAL: lazy sequences" :label "self-ref lazy-cat fib" :expected "[0 1 1 2 3 5 8 13 21 34]" :actual "(do (def fib-seq (lazy-cat [0 1] (map + (rest fib-seq) fib-seq))) (take 10 fib-seq))"}
|
|
{:suite "conformance / CRITICAL: multi-collection map" :label "map two colls" :expected "[11 22 33]" :actual "(map + [1 2 3] [10 20 30])"}
|
|
{:suite "conformance / CRITICAL: multi-collection map" :label "map three colls" :expected "[12 24 36]" :actual "(map + [1 2 3] [10 20 30] [1 2 3])"}
|
|
{:suite "conformance / CRITICAL: multi-collection map" :label "map uneven (shortest)" :expected "[[1 :a] [2 :b]]" :actual "(map vector [1 2 3] [:a :b])"}
|
|
{:suite "conformance / CRITICAL: multi-collection map" :label "map over range+vec" :expected "[1 3 5]" :actual "(map + (range 3) [1 2 3])"}
|
|
{:suite "conformance / CRITICAL: multi-collection map" :label "map fn list arg" :expected "[2 3 4]" :actual "(map inc (list 1 2 3))"}
|
|
{:suite "conformance / CRITICAL: iterate / infinite seqs" :label "iterate" :expected "[0 1 2 3 4]" :actual "(take 5 (iterate inc 0))"}
|
|
{:suite "conformance / CRITICAL: iterate / infinite seqs" :label "iterate double" :expected "[1 2 4 8 16]" :actual "(take 5 (iterate (fn [x] (* 2 x)) 1))"}
|
|
{:suite "conformance / CRITICAL: iterate / infinite seqs" :label "range over inf map" :expected "[1 2 3]" :actual "(take 3 (map inc (range)))"}
|
|
{:suite "conformance / CRITICAL: iterate / infinite seqs" :label "count of take" :expected "100" :actual "(count (take 100 (range)))"}
|
|
{:suite "conformance / CRITICAL: iterate / infinite seqs" :label "last of take" :expected "5" :actual "(last (take 5 (iterate inc 1)))"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "map as fn miss" :expected "nil" :actual "({:a 1} :z)"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "map as fn default" :expected "99" :actual "({:a 1} :z 99)"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "set literal computed" :expected "true" :actual "(= #{1 2} #{(inc 0) 2})"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "empty set literal" :expected "true" :actual "(empty? #{})"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "set literal count" :expected "3" :actual "(count #{1 2 3})"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "set literal in let" :expected "true" :actual "(let [x 5] (= #{5 6} #{x (inc x)}))"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "set? true" :expected "true" :actual "(set? #{1 2 3})"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "set? false" :expected "false" :actual "(set? [1 2])"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "disj one" :expected "#{1 3}" :actual "(disj #{1 2 3} 2)"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "disj many" :expected "#{1}" :actual "(disj #{1 2 3} 2 3)"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "disj absent" :expected "#{1 2}" :actual "(disj #{1 2} 5)"}
|
|
{:suite "conformance / CRITICAL: collections as IFn" :label "map fn over coll" :expected "[1 3]" :actual "(map {:a 1 :b 3} [:a :b])"}
|
|
{:suite "conformance / CRITICAL: vec / into over lazy + maps" :label "vec of map-result" :expected "[2 3 4]" :actual "(vec (map inc [1 2 3]))"}
|
|
{:suite "conformance / CRITICAL: vec / into over lazy + maps" :label "vec of range" :expected "[0 1 2 3 4]" :actual "(vec (range 5))"}
|
|
{:suite "conformance / CRITICAL: vec / into over lazy + maps" :label "into vec" :expected "[1 2 3 4 5 6]" :actual "(into [1 2 3] [4 5 6])"}
|
|
{:suite "conformance / CRITICAL: vec / into over lazy + maps" :label "into vec from lazy" :expected "[2 3 4]" :actual "(into [] (map inc [1 2 3]))"}
|
|
{:suite "conformance / CRITICAL: vec / into over lazy + maps" :label "into map pairs" :expected "{:a 1, :b 2}" :actual "(into {} [[:a 1] [:b 2]])"}
|
|
{:suite "conformance / CRITICAL: vec / into over lazy + maps" :label "into map onto map" :expected "{:a 1, :b 2, :c 3}" :actual "(into {:a 1} [[:b 2] [:c 3]])"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "map vec is seq" :expected "true" :actual "(seq? (map inc [1 2 3]))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "map vec not vector" :expected "false" :actual "(vector? (map inc [1 2 3]))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "filter vec is seq" :expected "true" :actual "(seq? (filter odd? [1 2 3]))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "take vec is seq" :expected "true" :actual "(seq? (take 2 [1 2 3]))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "map over set" :expected "true" :actual "(= #{2 3 4} (set (map inc #{1 2 3})))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "filter over map ev" :expected "[[:b 2]]" :actual "(filter (fn [[k v]] (> v 1)) {:a 1 :b 2})"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "cons cons lazy" :expected "[1 2 3]" :actual "(cons 1 (cons 2 (lazy-seq (cons 3 nil))))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "next empty lazy" :expected "nil" :actual "(next (take 1 [1]))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "drop vec is seq" :expected "true" :actual "(seq? (drop 1 [1 2 3]))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "distinct vec is seq" :expected "true" :actual "(seq? (distinct [1 1 2]))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "map-indexed is seq" :expected "true" :actual "(seq? (map-indexed vector [1 2]))"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "nth lazy false elem" :expected "false" :actual "(nth (map identity [false 1 2]) 0)"}
|
|
{:suite "conformance / Option A: lazy transformers return seqs, not vectors" :label "nth lazy past false" :expected "2" :actual "(nth (drop 1 (list false 1 2)) 1)"}
|
|
{:suite "conformance / HIGH: destructuring" :label "destr nested seq" :expected "[1 2 3]" :actual "(let [[a [b c]] [1 [2 3]]] [a b c])"}
|
|
{:suite "conformance / HIGH: destructuring" :label "destr rest+as" :expected "[1 [2 3] [1 2 3]]" :actual "(let [[a & r :as all] [1 2 3]] [a r all])"}
|
|
{:suite "conformance / HIGH: destructuring" :label "destr map :keys" :expected "[1 2]" :actual "(let [{:keys [a b]} {:a 1 :b 2}] [a b])"}
|
|
{:suite "conformance / HIGH: destructuring" :label "destr map :or" :expected "[1 99]" :actual "(let [{:keys [a b] :or {b 99}} {:a 1}] [a b])"}
|
|
{:suite "conformance / HIGH: destructuring" :label "destr map :strs" :expected "[1 2]" :actual "(let [{:strs [a b]} {\"a\" 1 \"b\" 2}] [a b])"}
|
|
{:suite "conformance / HIGH: destructuring" :label "destr nested map" :expected "5" :actual "(let [{{:keys [x]} :pos} {:pos {:x 5}}] x)"}
|
|
{:suite "conformance / HIGH: destructuring" :label "destr fn-param map" :expected "3" :actual "((fn [{:keys [a b]}] (+ a b)) {:a 1 :b 2})"}
|
|
{:suite "conformance / HIGH: destructuring" :label "destr let map key" :expected "1" :actual "(let [{a :a} {:a 1}] a)"}
|
|
{:suite "conformance / HIGH: update / assoc-in on map literals" :label "update extra args" :expected "{:a 111}" :actual "(update {:a 1} :a + 10 100)"}
|
|
{:suite "conformance / HIGH: update / assoc-in on map literals" :label "get-in" :expected "1" :actual "(get-in {:a {:b {:c 1}}} [:a :b :c])"}
|
|
{:suite "conformance / native-op parity (native ops at guarded arities)" :label "native mod floored" :expected "2" :actual "(mod -7 3)"}
|
|
{:suite "conformance / native-op parity (native ops at guarded arities)" :label "native rem truncated" :expected "-1" :actual "(rem -7 3)"}
|
|
{:suite "conformance / native-op parity (native ops at guarded arities)" :label "native unary div" :expected "1/2" :actual "(/ 2)"}
|
|
{:suite "conformance / native-op parity (native ops at guarded arities)" :label "native chained div" :expected "1" :actual "(/ 6 3 2)"}
|
|
{:suite "conformance / native-op parity (native ops at guarded arities)" :label "native bit-and" :expected "8" :actual "(bit-and 12 10)"}
|
|
{:suite "conformance / native-op parity (native ops at guarded arities)" :label "native bit-xor" :expected "6" :actual "(bit-xor 12 10)"}
|
|
{:suite "conformance / native-op parity (native ops at guarded arities)" :label "native shifts" :expected "[16 2]" :actual "[(bit-shift-left 4 2) (bit-shift-right 8 2)]"}
|
|
{:suite "conformance / multimethod preferences" :label "prefer-method breaks tie" :expected ":rect" :actual "(do (derive :cm/sq :cm/rect) (derive :cm/sq :cm/shape) (defmulti cmf identity) (defmethod cmf :cm/rect [x] :rect) (defmethod cmf :cm/shape [x] :shape) (prefer-method cmf :cm/rect :cm/shape) (cmf :cm/sq))"}
|
|
{:suite "conformance / HIGH: str semantics" :label "str concat nil" :expected "\"a1\"" :actual "(str \"a\" 1 nil)"}
|
|
{:suite "conformance / HIGH: str semantics" :label "str keyword" :expected "\":b\"" :actual "(str :b)"}
|
|
{:suite "conformance / HIGH: str semantics" :label "str symbol" :expected "\"foo\"" :actual "(str (quote foo))"}
|
|
{:suite "conformance / HIGH: str semantics" :label "str mixed" :expected "\"a:b1\"" :actual "(str \"a\" :b 1)"}
|
|
{:suite "conformance / HIGH: str semantics" :label "str seq" :expected "\"[1 2 3]\"" :actual "(str [1 2 3])"}
|
|
{:suite "conformance / HIGH: dispatch" :label "multimethod" :expected "9" :actual "(do (defmulti area :shape) (defmethod area :sq [s] (* (:s s) (:s s))) (area {:shape :sq :s 3}))"}
|
|
{:suite "conformance / HIGH: dispatch" :label "multimethod default" :expected ":def" :actual "(do (defmulti f identity) (defmethod f :default [x] :def) (f 99))"}
|
|
{:suite "conformance / HIGH: dispatch" :label "protocol on record" :expected "16" :actual "(do (defprotocol Sh (ar [s])) (defrecord Sq [side] Sh (ar [_] (* side side))) (ar (->Sq 4)))"}
|
|
{:suite "conformance / HIGH: dispatch" :label "deftype inline methods" :expected "7" :actual "(do (defprotocol Pi (mi [x])) (deftype Ti [v] Pi (mi [x] v)) (mi (->Ti 7)))"}
|
|
{:suite "conformance / HIGH: dispatch" :label "deftype two protocols" :expected "[1 2]" :actual "(do (defprotocol Pa (ma [x])) (defprotocol Pb (mb [x])) (deftype Tab [a b] Pa (ma [x] a) Pb (mb [x] b)) (let [t (->Tab 1 2)] [(ma t) (mb t)]))"}
|
|
{:suite "conformance / var fns as ordinary invokes (Stage 2 tier 6)" :label "var-get + call" :expected "2" :actual "((var-get (var inc)) 1)"}
|
|
{:suite "conformance / var fns as ordinary invokes (Stage 2 tier 6)" :label "var? true" :expected "true" :actual "(var? (var map))"}
|
|
{:suite "conformance / var fns as ordinary invokes (Stage 2 tier 6)" :label "var? false" :expected "false" :actual "(var? 5)"}
|
|
{:suite "conformance / var fns as ordinary invokes (Stage 2 tier 6)" :label "intern + find-var" :expected "41" :actual "(do (intern (quote user) (quote iv) 41) (var-get (find-var (quote user/iv))))"}
|
|
{:suite "conformance / var fns as ordinary invokes (Stage 2 tier 6)" :label "alter-var-root rest args" :expected "11" :actual "(do (def avr 1) (alter-var-root (var avr) + 4 6) avr)"}
|
|
{:suite "conformance / var fns as ordinary invokes (Stage 2 tier 6)" :label "alter-meta! + meta" :expected "7" :actual "(do (def amv 1) (alter-meta! (var amv) assoc :k 7) (:k (meta (var amv))))"}
|
|
{:suite "conformance / ns introspection fns as ordinary invokes (Stage 2 tier 6b)" :label "find-ns + ns-name" :expected "(quote clojure.core)" :actual "(ns-name (find-ns (quote clojure.core)))"}
|
|
{:suite "conformance / ns introspection fns as ordinary invokes (Stage 2 tier 6b)" :label "find-ns absent" :expected "nil" :actual "(find-ns (quote no.such.ns))"}
|
|
{:suite "conformance / ns introspection fns as ordinary invokes (Stage 2 tier 6b)" :label "create-ns + find" :expected "true" :actual "(do (create-ns (quote made.ns)) (some? (find-ns (quote made.ns))))"}
|
|
{:suite "conformance / ns introspection fns as ordinary invokes (Stage 2 tier 6b)" :label "remove-ns" :expected "nil" :actual "(do (create-ns (quote gone.ns)) (remove-ns (quote gone.ns)) (find-ns (quote gone.ns)))"}
|
|
{:suite "conformance / ns introspection fns as ordinary invokes (Stage 2 tier 6b)" :label "the-ns of symbol" :expected "(quote user)" :actual "(ns-name (the-ns (quote user)))"}
|
|
{:suite "conformance / ns introspection fns as ordinary invokes (Stage 2 tier 6b)" :label "ns-resolve + call" :expected "3" :actual "((var-get (ns-resolve (quote clojure.core) (quote inc))) 2)"}
|
|
{:suite "conformance / ns introspection fns as ordinary invokes (Stage 2 tier 6b)" :label "resolve + call" :expected "3" :actual "((var-get (resolve (quote inc))) 2)"}
|
|
{:suite "conformance / ns introspection fns as ordinary invokes (Stage 2 tier 6b)" :label "resolve absent" :expected "nil" :actual "(resolve (quote no-such-sym-xyz))"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "get-method + call" :expected "1" :actual "(do (defmulti t6f :k) (defmethod t6f :a [x] 1) ((get-method t6f :a) {:k :a}))"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "remove-method" :expected "nil" :actual "(do (defmulti t6g :k) (defmethod t6g :b [x] 2) (remove-method t6g :b) (get (methods t6g) :b))"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "remove-all-methods" :expected "nil" :actual "(do (defmulti t6h :k) (defmethod t6h :c [x] 3) (remove-all-methods t6h) (get (methods t6h) :c))"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "prefer-method records" :expected "true" :actual "(do (defmulti t6p identity) (prefer-method t6p :rect :shape) (contains? (get (prefers t6p) :rect) :shape))"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "instance? deftype" :expected "true" :actual "(do (deftype T6i [a]) (instance? T6i (->T6i 1)))"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "instance? String" :expected "true" :actual "(instance? String \"s\")"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "locking evals body" :expected "3" :actual "(locking :anything (+ 1 2))"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "locking evals monitor" :expected "[3 1]" :actual "(let [a (atom 0)] [(locking (swap! a inc) 3) @a])"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "defonce keeps first" :expected "5" :actual "(do (defonce d6o 5) (defonce d6o 9) d6o)"}
|
|
{:suite "conformance / dispatch-table ops + misc as macros/fns (Stage 2 tier 6c)" :label "read-string + eval" :expected "3" :actual "(eval (read-string \"(+ 1 2)\"))"}
|
|
{:suite "conformance / uuid" :label "uuid as map key" :expected ":v" :actual "(get {(parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\") :v} (parse-uuid \"b6883c0a-0342-4007-9966-bc2dfa6b109e\"))"}
|
|
{:suite "conformance / 1.11 additions + ns fns (spec 35-var batch A)" :label "parse-long bad" :expected "nil" :actual "(parse-long \"4.2\")"}
|
|
{:suite "conformance / 1.11 additions + ns fns (spec 35-var batch A)" :label "update-keys" :expected "{\"a\" 1}" :actual "(update-keys {:a 1} name)"}
|
|
{:suite "conformance / 1.11 additions + ns fns (spec 35-var batch A)" :label "update-vals" :expected "{:a 2}" :actual "(update-vals {:a 1} inc)"}
|
|
{:suite "conformance / 1.11 additions + ns fns (spec 35-var batch A)" :label "partition pad" :expected "[[0 1 2 3] [4 5 6 7] [8 9 :a]]" :actual "(partition 4 4 [:a] (range 10))"}
|
|
{:suite "conformance / 1.11 additions + ns fns (spec 35-var batch A)" :label "with-redefs" :expected "[42 1]" :actual "(do (defn cwr [] 1) [(with-redefs [cwr (fn [] 42)] (cwr)) (cwr)])"}
|
|
{:suite "conformance / 1.11 additions + ns fns (spec 35-var batch A)" :label "macroexpand" :expected "true" :actual "(= (quote if) (first (macroexpand (quote (when-not false 1)))))"}
|
|
{:suite "conformance / 1.11 additions + ns fns (spec 35-var batch A)" :label "require bare symbol" :expected "\"a,b\"" :actual "(do (require (quote clojure.string)) (clojure.string/join \",\" [\"a\" \"b\"]))"}
|
|
{:suite "conformance / 1.11 additions + ns fns (spec 35-var batch A)" :label "ns-publics lookup" :expected "true" :actual "(do (def cnp 7) (some? (get (ns-publics (quote user)) (quote cnp))))"}
|
|
{:suite "conformance / #inst + syntax-quote literal collapse (spec 2.4/2.3)" :label "inst partial = full" :expected "true" :actual "(= #inst \"2020\" #inst \"2020-01-01T00:00:00Z\")"}
|
|
{:suite "conformance / #inst + syntax-quote literal collapse (spec 2.4/2.3)" :label "sq number collapse" :expected "42" :actual "``42"}
|
|
{:suite "conformance / vars replace the root-env leak" :label "compare total order" :expected "[-1 0 1]" :actual "[(compare nil 1) (compare :a :a) (compare \"b\" \"a\")]"}
|
|
{:suite "conformance / vars replace the root-env leak" :label "any? anything" :expected "true" :actual "(and (any? nil) (any? 1) (any? :k))"}
|
|
{:suite "conformance / vars replace the root-env leak" :label "macroexpand-1 when" :expected "2" :actual "(count (rest (macroexpand-1 (quote (when true 1)))))"}
|
|
{:suite "conformance / HIGH: aliased namespace calls" :label "require :as alias" :expected "\"1,2,3\"" :actual "(do (require (quote [clojure.string :as s])) (s/join \",\" [1 2 3]))"}
|
|
{:suite "conformance / HIGH: aliased namespace calls" :label "ns form + alias" :expected "\"HI\"" :actual "(do (ns my.a (:require [clojure.string :as s])) (s/upper-case \"hi\"))"}
|
|
{:suite "conformance / HIGH: aliased namespace calls" :label "ns :use refers" :expected "42" :actual "(do (ns src.u) (def helper 42) (ns dst.u (:use [src.u])) helper)"}
|
|
{:suite "conformance / MED: missing core fns" :label "subvec" :expected "[2 3]" :actual "(subvec [1 2 3 4 5] 1 3)"}
|
|
{:suite "conformance / MED: missing core fns" :label "subvec to-end" :expected "[3 4 5]" :actual "(subvec [1 2 3 4 5] 2)"}
|
|
{:suite "conformance / MED: missing core fns" :label "reduce-kv" :expected "{:a 2, :b 3}" :actual "(reduce-kv (fn [m k v] (assoc m k (inc v))) {} {:a 1 :b 2})"}
|
|
{:suite "conformance / iterating maps yields entries" :label "reduce over map" :expected "6" :actual "(reduce (fn [a [k v]] (+ a v)) 0 {:a 1 :b 2 :c 3})"}
|
|
{:suite "conformance / iterating maps yields entries" :label "into transform map" :expected "{:a 2, :b 3}" :actual "(into {} (map (fn [[k v]] [k (inc v)]) {:a 1 :b 2}))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "filter over map" :expected "true" :actual "(= [[:b 2]] (filterv (fn [[k v]] (> v 1)) {:a 1 :b 2}))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "tree-seq" :expected "[1 2 3]" :actual "(map (fn [x] x) (filter (complement coll?) (tree-seq coll? seq [1 [2 [3]]])))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "key/val" :expected "true" :actual "(let [e (first {:k 9})] (and (= :k (key e)) (= 9 (val e))))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "nat-int?" :expected "true" :actual "(and (nat-int? 0) (nat-int? 5) (not (nat-int? -1)))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "list* prepend" :expected "[1 2 3 4]" :actual "(list* 1 2 [3 4])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "cycle" :expected "[1 2 3 1 2 3 1]" :actual "(take 7 (cycle [1 2 3]))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "partition-all" :expected "[[1 2] [3 4] [5]]" :actual "(partition-all 2 [1 2 3 4 5])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "reductions init" :expected "[0 1 3 6]" :actual "(reductions + 0 [1 2 3])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "dedupe" :expected "[1 2 3 1]" :actual "(dedupe [1 1 2 3 3 1])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "partition-by odd?" :expected "[[1 1] [2] [3 3]]" :actual "(partition-by odd? [1 1 2 3 3])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "reductions inf" :expected "[0 1 3 6]" :actual "(take 4 (reductions + (range)))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "tree-seq strict" :expected "10" :actual "(reduce + 0 (filter (complement coll?) (tree-seq coll? seq [1 [2 [3 4]]])))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "case nil + default" :expected "[:nilr :def]" :actual "(let [f (fn [x] (case x 1 :one nil :nilr :def))] [(f nil) (f 9)])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "case collection consts" :expected "[:v :m :s]" :actual "(let [f (fn [x] (case x [1 2] :v {:a 1} :m #{3} :s :def))] [(f [1 2]) (f {:a 1}) (f #{3})])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "seq of nil-first" :expected "true" :actual "(boolean (seq (cons nil (list 1))))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "reverse nil elem" :expected "[2 nil 1]" :actual "(vec (reverse (list 1 nil 2)))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "map non-seqable throws" :expected "true" :actual "(try (doall (map inc 5)) false (catch Throwable _ true))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "keep-indexed" :expected "[:b :d]" :actual "(keep-indexed (fn [i x] (if (odd? i) x)) [:a :b :c :d])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "map-indexed" :expected "[[0 :a] [1 :b]]" :actual "(map-indexed (fn [i x] [i x]) [:a :b])"}
|
|
{:suite "conformance / iterating maps yields entries" :label "trampoline" :expected ":done" :actual "(do (defn a [n] (if (zero? n) :done (fn [] (a (dec n))))) (trampoline a 5))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "format" :expected "\"1-x\"" :actual "(format \"%d-%s\" 1 \"x\")"}
|
|
{:suite "conformance / iterating maps yields entries" :label "read-string" :expected "(quote (+ 1 2))" :actual "(read-string \"(+ 1 2)\")"}
|
|
{:suite "conformance / iterating maps yields entries" :label "letfn mutual" :expected "true" :actual "(letfn [(ev? [n] (if (= n 0) true (od? (dec n)))) (od? [n] (if (= n 0) false (ev? (dec n))))] (ev? 10))"}
|
|
{:suite "conformance / iterating maps yields entries" :label "doseq side" :expected "[1 2 3]" :actual "(do (def a (atom [])) (doseq [x [1 2 3]] (swap! a conj x)) @a)"}
|
|
{:suite "conformance / iterating maps yields entries" :label "doseq nested" :expected "4" :actual "(do (def c (atom 0)) (doseq [x [1 2] y [10 20]] (swap! c inc)) @c)"}
|
|
{:suite "conformance / MED: lazy filter / take-while over infinite seqs" :label "lazy filter inf" :expected "[1 3 5 7 9]" :actual "(take 5 (filter odd? (range)))"}
|
|
{:suite "conformance / MED: lazy filter / take-while over infinite seqs" :label "lazy take-while inf" :expected "[0 1 2 3 4]" :actual "(take-while (fn [x] (< x 5)) (range))"}
|
|
{:suite "conformance / MED: lazy filter / take-while over infinite seqs" :label "lazy remove inf" :expected "[0 2 4 6 8]" :actual "(take 5 (remove odd? (range)))"}
|
|
{:suite "conformance / MED: lazy filter / take-while over infinite seqs" :label "filter finite" :expected "[2 4]" :actual "(filter even? [1 2 3 4 5])"}
|
|
{:suite "conformance / atoms (full support)" :label "swap! args" :expected "7" :actual "(do (def a (atom 1)) (swap! a + 2 4) @a)"}
|
|
{:suite "conformance / atoms (full support)" :label "reset! ret" :expected "9" :actual "(do (def a (atom 1)) (reset! a 9))"}
|
|
{:suite "conformance / atoms (full support)" :label "compare-and-set!" :expected "true" :actual "(do (def a (atom 1)) (compare-and-set! a 1 2))"}
|
|
{:suite "conformance / atoms (full support)" :label "compare-and-set! no" :expected "false" :actual "(do (def a (atom 1)) (compare-and-set! a 5 2))"}
|
|
{:suite "conformance / atoms (full support)" :label "swap-vals!" :expected "[1 2]" :actual "(do (def a (atom 1)) (swap-vals! a inc))"}
|
|
{:suite "conformance / atoms (full support)" :label "reset-vals!" :expected "[1 9]" :actual "(do (def a (atom 1)) (reset-vals! a 9))"}
|
|
{:suite "conformance / atoms (full support)" :label "atom map swap" :expected "{:a 1, :b 2}" :actual "(do (def a (atom {:a 1})) (swap! a assoc :b 2) @a)"}
|
|
{:suite "conformance / atoms (full support)" :label "add-watch" :expected "[:k 1 2]" :actual "(do (def lg (atom nil)) (def a (atom 1)) (add-watch a :k (fn [k r o n] (reset! lg [k o n]))) (swap! a inc) @lg)"}
|
|
{:suite "conformance / atoms (full support)" :label "atom validator" :expected "5" :actual "(do (def a (atom 1 :validator pos?)) (reset! a 5) @a)"}
|
|
{:suite "conformance / atoms (full support)" :label "instance? Atom" :expected "true" :actual "(instance? clojure.lang.Atom (atom 1))"}
|
|
{:suite "conformance / volatiles / delays" :label "volatile" :expected "2" :actual "(do (def v (volatile! 1)) (vreset! v 2) @v)"}
|
|
{:suite "conformance / volatiles / delays" :label "vswap!" :expected "2" :actual "(do (def v (volatile! 1)) (vswap! v inc) @v)"}
|
|
{:suite "conformance / volatiles / delays" :label "delay force" :expected "3" :actual "(force (delay (+ 1 2)))"}
|
|
{:suite "conformance / volatiles / delays" :label "delay deref once" :expected "1" :actual "(do (def c (atom 0)) (def d (delay (swap! c inc))) @d @d @c)"}
|
|
{:suite "conformance / volatiles / delays" :label "realized? delay" :expected "true" :actual "(do (def d (delay 1)) @d (realized? d))"}
|
|
{:suite "conformance / volatiles / delays" :label "realized? not" :expected "false" :actual "(realized? (delay 1))"}
|
|
{:suite "conformance / numbers / math" :label "quot neg" :expected "-2" :actual "(quot -7 3)"}
|
|
{:suite "conformance / numbers / math" :label "bit ops" :expected "[4 14 10]" :actual "[(bit-and 12 6) (bit-or 12 6) (bit-xor 12 6)]"}
|
|
{:suite "conformance / numbers / math" :label "bit-shift" :expected "[8 2]" :actual "[(bit-shift-left 1 3) (bit-shift-right 8 2)]"}
|
|
{:suite "conformance / numbers / math" :label "Math/sqrt" :expected "3.0" :actual "(Math/sqrt 9)"}
|
|
{:suite "conformance / numbers / math" :label "Math/pow" :expected "8.0" :actual "(Math/pow 2 3)"}
|
|
{:suite "conformance / numbers / math" :label "min-key" :expected "1" :actual "(min-key abs 1 -2 3)"}
|
|
{:suite "conformance / numbers / math" :label "max-key" :expected "-4" :actual "(max-key abs 1 -2 -4 3)"}
|
|
{:suite "conformance / strings (clojure.string)" :label "str/trim" :expected "\"hi\"" :actual "(do (require (quote [clojure.string :as s])) (s/trim \" hi \"))"}
|
|
{:suite "conformance / strings (clojure.string)" :label "str/split regex" :expected "[\"a\" \"b\" \"c\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"a,b,c\" #\",\"))"}
|
|
{:suite "conformance / strings (clojure.string)" :label "str/split ws" :expected "[\"a\" \"b\" \"c\"]" :actual "(do (require (quote [clojure.string :as s])) (s/split \"a b c\" #\"\\s+\"))"}
|
|
{:suite "conformance / strings (clojure.string)" :label "str/replace" :expected "\"hexxo\"" :actual "(do (require (quote [clojure.string :as s])) (s/replace \"hello\" \"ll\" \"xx\"))"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "str/replace regex" :expected "\"ab\"" :actual "(do (require (quote [clojure.string :as s])) (s/replace \"a1b2\" #\"[0-9]\" \"\"))"}
|
|
{:suite "conformance / strings (clojure.string)" :label "subs" :expected "\"ell\"" :actual "(subs \"hello\" 1 4)"}
|
|
{:suite "conformance / regex" :label "re-find" :expected "\"123\"" :actual "(re-find #\"[0-9]+\" \"abc123def\")"}
|
|
{:suite "conformance / regex" :label "re-matches" :expected "\"abc\"" :actual "(re-matches #\"a.c\" \"abc\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "re-matches no" :expected "nil" :actual "(re-matches #\"a.c\" \"abcd\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "re-seq" :expected "[\"12\" \"34\"]" :actual "(re-seq #\"[0-9]+\" \"a12b34\")"}
|
|
{:suite "conformance / sequences" :label "split-at" :expected "[[1 2] [3 4 5]]" :actual "(split-at 2 [1 2 3 4 5])"}
|
|
{:suite "conformance / sequences" :label "split-with" :expected "[[1 2] [3 4 1]]" :actual "(split-with (fn [x] (< x 3)) [1 2 3 4 1])"}
|
|
{:suite "conformance / sequences" :label "partition step" :expected "[[1 2] [3 4]]" :actual "(partition 2 2 [1 2 3 4 5])"}
|
|
{:suite "conformance / sequences" :label "not-every?" :expected "true" :actual "(not-every? pos? [1 -2 3])"}
|
|
{:suite "conformance / overlay migration: run in all 3 modes" :label "not-any?" :expected "true" :actual "(not-any? neg? [1 2 3])"}
|
|
{:suite "conformance / sequences" :label "take-nth" :expected "[0 2 4]" :actual "(take-nth 2 [0 1 2 3 4])"}
|
|
{:suite "conformance / sequences" :label "butlast" :expected "[1 2]" :actual "(butlast [1 2 3])"}
|
|
{:suite "conformance / sequences" :label "empty" :expected "[]" :actual "(empty [1 2 3])"}
|
|
{:suite "conformance / sequences" :label "replace map" :expected "[:a :b :a]" :actual "(replace {1 :a 2 :b} [1 2 1])"}
|
|
{:suite "conformance / data structures" :label "sorted-map seq" :expected "[[:a 1] [:b 2] [:c 3]]" :actual "(seq (sorted-map :c 3 :a 1 :b 2))"}
|
|
{:suite "conformance / data structures" :label "sorted-set seq" :expected "[1 2 3]" :actual "(seq (sorted-set 3 1 2))"}
|
|
{:suite "conformance / data structures" :label "coll? set" :expected "true" :actual "(coll? #{1 2})"}
|
|
{:suite "conformance / data structures" :label "conj map entry" :expected "{:a 1, :b 2}" :actual "(conj {:a 1} [:b 2])"}
|
|
{:suite "conformance / metadata / vars" :label "vary-meta" :expected "{:x 2}" :actual "(meta (vary-meta (with-meta [1] {:x 1}) update :x inc))"}
|
|
{:suite "conformance / metadata / vars" :label "defonce no-redef" :expected "1" :actual "(do (defonce dv1 1) (defonce dv1 2) dv1)"}
|
|
{:suite "conformance / metadata / vars" :label "binding dynamic" :expected "10" :actual "(do (def ^:dynamic *x* 1) (binding [*x* 10] *x*))"}
|
|
{:suite "conformance / try / catch" :label "try catch" :expected ":caught" :actual "(try (throw (ex-info \"e\" {})) (catch :default e :caught))"}
|
|
{:suite "conformance / try / catch" :label "ex-data" :expected "{:a 1}" :actual "(try (throw (ex-info \"m\" {:a 1})) (catch :default e (ex-data e)))"}
|
|
{:suite "conformance / try / catch" :label "ex-message" :expected "\"m\"" :actual "(try (throw (ex-info \"m\" {})) (catch :default e (ex-message e)))"}
|
|
{:suite "conformance / macros" :label "macroexpand-1" :expected "true" :actual "(do (defmacro mm [x] (list (quote inc) x)) (= (quote (inc 5)) (macroexpand-1 (quote (mm 5)))))"}
|
|
{:suite "conformance / macros" :label "doto" :expected "{:a 1}" :actual "(deref (doto (atom {}) (swap! assoc :a 1)))"}
|
|
{:suite "conformance / printing" :label "prn-str" :expected "\"1\\n\"" :actual "(prn-str 1)"}
|
|
{:suite "conformance / characters" :label "char not string" :expected "false" :actual "(= \\a \"a\")"}
|
|
{:suite "conformance / characters" :label "char eq" :expected "true" :actual "(= \\a \\a)"}
|
|
{:suite "conformance / characters" :label "int of char" :expected "97" :actual "(int \\a)"}
|
|
{:suite "conformance / characters" :label "char of int" :expected "true" :actual "(= \\A (char 65))"}
|
|
{:suite "conformance / characters" :label "str of chars" :expected "\"abc\"" :actual "(str \\a \\b \\c)"}
|
|
{:suite "conformance / characters" :label "first of string" :expected "\\h" :actual "(first \"hello\")"}
|
|
{:suite "conformance / characters" :label "nth of string" :expected "\\e" :actual "(nth \"hello\" 1)"}
|
|
{:suite "conformance / characters" :label "char newline" :expected "10" :actual "(int \\newline)"}
|
|
{:suite "conformance / characters" :label "char space" :expected "32" :actual "(int \\space)"}
|
|
{:suite "conformance / characters" :label "pr-str char" :expected "\"\\\\a\"" :actual "(pr-str \\a)"}
|
|
{:suite "conformance / characters" :label "chars in vec" :expected "[\\a \\b]" :actual "[\\a \\b]"}
|
|
{:suite "conformance / characters" :label "apply str chars" :expected "\"hi\"" :actual "(apply str [\\h \\i])"}
|
|
{:suite "conformance / transducers" :label "transduce map" :expected "9" :actual "(transduce (map inc) + 0 [1 2 3])"}
|
|
{:suite "conformance / transducers" :label "transduce comp" :expected "12" :actual "(transduce (comp (map inc) (filter even?)) + 0 [1 2 3 4 5])"}
|
|
{:suite "conformance / transducers" :label "transduce conj" :expected "[2 3 4]" :actual "(transduce (map inc) conj [] [1 2 3])"}
|
|
{:suite "conformance / transducers" :label "into comp xform" :expected "[1 9 25]" :actual "(into [] (comp (filter odd?) (map (fn [x] (* x x)))) [1 2 3 4 5])"}
|
|
{:suite "conformance / transducers" :label "into take xform" :expected "[0 1 2]" :actual "(into [] (take 3) (range 100))"}
|
|
{:suite "conformance / transducers" :label "transduce no-init" :expected "6" :actual "(transduce (map inc) + [0 1 2])"}
|
|
{:suite "conformance / transducers" :label "transduce drop" :expected "[3 4 5]" :actual "(into [] (drop 2) [1 2 3 4 5])"}
|
|
{:suite "conformance / transducers" :label "transduce remove" :expected "[1 3 5]" :actual "(into [] (remove even?) [1 2 3 4 5])"}
|
|
{:suite "conformance / transducers" :label "transduce take-while" :expected "[1 2]" :actual "(into [] (take-while (fn [x] (< x 3))) [1 2 3 4 1])"}
|
|
{:suite "conformance / transducers" :label "transduce map-indexed" :expected "[[0 :a] [1 :b]]" :actual "(into [] (map-indexed (fn [i x] [i x])) [:a :b])"}
|
|
{:suite "conformance / transducers" :label "partition-all xform" :expected "[[1 2] [3 4] [5]]" :actual "(into [] (partition-all 2) [1 2 3 4 5])"}
|
|
{:suite "conformance / transducers" :label "partition-all xform comp" :expected "[2 2 1]" :actual "(into [] (comp (partition-all 2) (map count)) [1 2 3 4 5])"}
|
|
{:suite "conformance / transducers" :label "partition-by xform" :expected "[[1 1] [2 4] [5]]" :actual "(into [] (partition-by odd?) [1 1 2 4 5])"}
|
|
{:suite "conformance / transducers" :label "partition-by xform reduced" :expected "[[1 1] [2 4]]" :actual "(into [] (comp (partition-by odd?) (take 2)) [1 1 2 4 5 5])"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "re-find groups" :expected "[\"12-34\" \"12\" \"34\"]" :actual "(re-find #\"(\\d+)-(\\d+)\" \"x12-34y\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "re-find no-groups" :expected "\"123\"" :actual "(re-find #\"\\d+\" \"ab123\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "re-matches groups" :expected "[\"1.2\" \"1\" \"2\"]" :actual "(re-matches #\"(\\d+)\\.(\\d+)\" \"1.2\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "greedy backtrack" :expected "\"xxfoo\"" :actual "(re-find #\".*foo\" \"xxfoo\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "greedy thru group" :expected "[\"a,b,c\" \"a,b\" \"c\"]" :actual "(re-find #\"(.*),(.*)\" \"a,b,c\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "lazy quantifier" :expected "[\"<a>\" \"a\"]" :actual "(re-find #\"<(.+?)>\" \"<a><b>\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "flag case-insens" :expected "\"CAT\"" :actual "(re-find #\"(?i)cat\" \"a CAT\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "lookahead" :expected "\"foo\"" :actual "(re-find #\"foo(?=bar)\" \"foobar\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "neg-lookahead" :expected "\"foo\"" :actual "(re-find #\"foo(?!bar)\" \"foobaz\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "word-boundary" :expected "\"word\"" :actual "(re-find #\"\\bword\\b\" \"a word!\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "word-boundary no" :expected "nil" :actual "(re-find #\"\\bword\\b\" \"swordfish\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "optional group" :expected "[\"1.2.3\" \"1\" \"2\" \"3\" nil]" :actual "(re-find #\"(\\d+)\\.(\\d+)\\.(\\d+)(?:-([a-z]+))?\" \"1.2.3\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "alternation" :expected "\"dog\"" :actual "(re-find #\"cat|dog\" \"a dog cat\")"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "str/replace $1" :expected "\"he[ll]o\"" :actual "(do (require (quote [clojure.string :as s])) (s/replace \"hello\" #\"(l+)\" \"[$1]\"))"}
|
|
{:suite "conformance / regex (capturing groups, backtracking, flags, lookahead)" :label "str/replace regex (2)" :expected "\"X-X\"" :actual "(do (require (quote [clojure.string :as s])) (s/replace \"a-b\" #\"[a-z]\" \"X\"))"}
|
|
{:suite "conformance / map literals evaluate their values" :label "map literal var" :expected "{:k 5}" :actual "(let [x 5] {:k x})"}
|
|
{:suite "conformance / map literals evaluate their values" :label "map literal nested" :expected "{:a {:b 2}}" :actual "(let [y 2] {:a {:b y}})"}
|
|
{:suite "conformance / map literals evaluate their values" :label "map literal keyfn" :expected "{:x 1}" :actual "(let [k :x] {k 1})"}
|
|
{:suite "conformance / map literals evaluate their values" :label "map literal in fn" :expected "6" :actual "(do (defn mk [a b] {:sum (+ a b)}) (:sum (mk 2 4)))"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "def 3-arg docstring" :expected "42" :actual "(do (def dd \"the doc\" 42) dd)"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "def docstring value type" :expected "true" :actual "(do (def ds \"doc\" [1 2]) (vector? ds))"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "def ^{:map} name" :expected "5" :actual "(do (def ^{:private true} mmv 5) mmv)"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "defn ^{:map} name" :expected "25" :actual "(do (defn ^{:private true} sqf [x] (* x x)) (sqf 5))"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "defmacro arity-clause" :expected "10" :actual "(do (defmacro m2c ([x] (list (quote *) x 2))) (m2c 5))"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "defmacro doc + arity" :expected "30" :actual "(do (defmacro m3c \"doc\" ([x] (list (quote *) x 3))) (* (m3c 5) 2))"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "defmulti docstring" :expected "\"A\"" :actual "(do (defmulti gmm \"the doc\" identity) (defmethod gmm :a [_] \"A\") (gmm :a))"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "try multi-body last" :expected "3" :actual "(try 1 2 3 (catch :default e 0))"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "try finally on ok+catch" :expected "9" :actual "(let [a (atom 0)] (try 1 2 (catch :default e :c) (finally (reset! a 9))) @a)"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "ns restored after catch" :expected "\"user\"" :actual "(do (ns cf.boom) (defn bz [] (throw (Exception. \"e\"))) (in-ns (quote user)) (try (cf.boom/bz) (catch :default e nil)) (str *ns*))"}
|
|
{:suite "conformance / migratus enablement: def/defmacro/defmulti forms, assoc, try, ns" :label "cross-ns methods visible" :expected "[:sql]" :actual "(do (ns cf.mm) (defmulti ext identity) (defmethod ext :default [_] :d) (defn allk [] (vec (for [[k v] (methods ext) :when (not= k :default)] k))) (ns cf.mmi) (defmethod cf.mm/ext :sql [_] :s) (in-ns (quote user)) (cf.mm/allk))"}
|
|
{:suite "conformance / defmacro surface + syntax-quote/ns (enabling real clojure libs)" :label "defmacro multi-arity" :expected "[6 5 6]" :actual "(do (defmacro mar ([a] (list (quote +) a 1)) ([a b] (list (quote +) a b)) ([a b c] (list (quote +) a b c))) [(mar 5) (mar 2 3) (mar 1 2 3)])"}
|
|
{:suite "conformance / defmacro surface + syntax-quote/ns (enabling real clojure libs)" :label "defmacro doc + attr-map" :expected "10" :actual "(do (defmacro mam \"doc\" {:arglists (quote ([x]))} [x] (list (quote inc) x)) (mam 9))"}
|
|
{:suite "conformance / defmacro surface + syntax-quote/ns (enabling real clojure libs)" :label "syntax-quote resolves alias" :expected "\"HI\"" :actual "(do (ns sq.lib (:require [clojure.string :as s])) (defmacro up [x] `(s/upper-case ~x)) (in-ns (quote user)) (sq.lib/up \"hi\"))"}
|
|
{:suite "conformance / defmacro surface + syntax-quote/ns (enabling real clojure libs)" :label "ns name with ^{:map} meta" :expected "5" :actual "(do (ns ^{:author \"a\" :doc \"d\"} nm.meta) (def q 5) (in-ns (quote user)) nm.meta/q)"}
|
|
{:suite "conformance / defmacro surface + syntax-quote/ns (enabling real clojure libs)" :label "unquote *ns* in template" :expected "true" :actual "(do (defmacro cur-ns [] `(str ~*ns*)) (string? (cur-ns)))"}
|
|
{:suite "reader / read-string constructs sets" :label "top-level set" :expected "true" :actual "(set? (read-string \"#{:a :b}\"))"}
|
|
{:suite "reader / read-string constructs sets" :label "set value equals" :expected "true" :actual "(= #{1 2} (read-string \"#{1 2}\"))"}
|
|
{:suite "reader / read-string constructs sets" :label "set nested in map" :expected "true" :actual "(set? (:k (read-string \"{:k #{:a :b}}\")))"}
|
|
{:suite "reader / read-string constructs sets" :label "set nested in vector" :expected "true" :actual "(set? (first (read-string \"[#{:a}]\")))"}
|
|
{:suite "reader / read-string constructs sets" :label "set nested in list" :expected "true" :actual "(set? (first (read-string \"(#{:a})\")))"}
|
|
{:suite "reader / read-string constructs sets" :label "set keeps reader metadata" :expected "true" :actual "(:s (meta (read-string \"^:s #{1 2}\")))"}
|
|
{:suite "reader / read-string constructs sets" :label "set of sets" :expected "true" :actual "(every? set? (read-string \"#{#{1} #{2}}\"))"}
|
|
{:suite "io / str & format" :label "format %x lowercase" :expected "\"ff\"" :actual "(format \"%x\" 255)"}
|
|
{:suite "io / str & format" :label "format %04x zero-pad lower" :expected "\"00ff\"" :actual "(format \"%04x\" 255)"}
|
|
{:suite "io / str & format" :label "format %X uppercase" :expected "\"00FF\"" :actual "(format \"%04X\" 255)"}
|
|
{:suite "io / str & format" :label "format %x wide hex" :expected "\"deadbeef\"" :actual "(format \"%x\" 3735928559)"}
|
|
{:suite "protocols / extend & extends? on nil" :label "extend nil dispatches" :expected ":nil-via-extend" :actual "(do (defprotocol P2 (q [this])) (extend nil P2 {:q (fn [_] :nil-via-extend)}) (q nil))"}
|
|
{:suite "protocols / extend & extends? on nil" :label "extends? nil when extended" :expected "true" :actual "(do (defprotocol Pe (pe [this])) (extend nil Pe {:pe (fn [_] :x)}) (extends? Pe nil))"}
|
|
{:suite "protocols / extend & extends? on nil" :label "extends? nil when not extended" :expected "false" :actual "(do (defprotocol P3 (r [this])) (extends? P3 nil))"}
|
|
{:suite "protocols / extend & extends? on nil" :label "extend-type nil still works" :expected ":via-type" :actual "(do (defprotocol P4 (s [this])) (extend-type nil P4 (s [_] :via-type)) (s nil))"}
|
|
{:suite "protocols / extend on host classes" :label "dispatch by java.util.Map/Collection/CharSequence" :expected "[:map :coll :str :obj]" :actual "(do (defprotocol W (-w [x])) (extend java.util.Map W {:-w (fn [_] :map)}) (extend java.util.Collection W {:-w (fn [_] :coll)}) (extend java.lang.CharSequence W {:-w (fn [_] :str)}) (extend java.lang.Object W {:-w (fn [_] :obj)}) [(-w {:a 1}) (-w [1 2]) (-w \"s\") (-w 42)])"}
|
|
{:suite "protocols / extend on host classes" :label "satisfies? via java.util.Map" :expected "true" :actual "(do (defprotocol Q (qq [x])) (extend java.util.Map Q {:qq (fn [_] :m)}) (satisfies? Q {}))"}
|
|
{:suite "protocols / extend on host classes" :label "extends? on a qualified host class" :expected "true" :actual "(do (defprotocol Qe (qe [x])) (extend java.util.Collection Qe {:qe (fn [_] :c)}) (extends? Qe java.util.Collection))"}
|
|
{:suite "interop / instance? on host interfaces" :label "keyword is Named" :expected "true" :actual "(instance? clojure.lang.Named :a)"}
|
|
{:suite "interop / instance? on host interfaces" :label "string is CharSequence" :expected "true" :actual "(instance? java.lang.CharSequence \"s\")"}
|
|
{:suite "interop / instance? on host interfaces" :label "number is Number" :expected "true" :actual "(instance? java.lang.Number 42)"}
|
|
{:suite "interop / instance? on host interfaces" :label "map is java.util.Map" :expected "true" :actual "(instance? java.util.Map {:a 1})"}
|
|
{:suite "interop / instance? on host interfaces" :label "vector is java.util.List" :expected "true" :actual "(instance? java.util.List [1 2])"}
|
|
{:suite "interop / instance? on host interfaces" :label "list is java.util.Collection" :expected "true" :actual "(instance? java.util.Collection (list 1))"}
|
|
{:suite "interop / instance? on host interfaces" :label "set is java.util.Set" :expected "true" :actual "(instance? java.util.Set #{1})"}
|
|
{:suite "interop / instance? on host interfaces" :label "map is not a Collection" :expected "false" :actual "(instance? java.util.Collection {:a 1})"}
|
|
{:suite "interop / instance? on host interfaces" :label "vector is Associative" :expected "true" :actual "(instance? clojure.lang.Associative [1])"}
|
|
{:suite "interop / instance? on host interfaces" :label "string is not Number" :expected "false" :actual "(instance? java.lang.Number \"s\")"}
|
|
{:suite "interop / String & StringBuilder char ops" :label "String from char-array slice" :expected "\"abc\"" :actual "(String. (char-array [\\a \\b \\c \\d]) 0 3)"}
|
|
{:suite "interop / String & StringBuilder char ops" :label "str of StringBuilder" :expected "\"hi\"" :actual "(let [sb (StringBuilder.)] (.append sb \"hi\") (str sb))"}
|
|
{:suite "interop / String & StringBuilder char ops" :label "append subsequence" :expected "\"bcd\"" :actual "(let [sb (StringBuilder.)] (.append sb \"abcde\" 1 4) (.toString sb))"}
|
|
{:suite "interop / String & StringBuilder char ops" :label "String.getChars into buffer" :expected "\"abc\"" :actual "(let [a (char-array 4)] (.getChars \"abcd\" 0 3 a 0) (String. a 0 3))"}
|
|
{:suite "interop / numbers & classes" :label "Integer/toHexString lowercase" :expected "\"ff\"" :actual "(Integer/toHexString 255)"}
|
|
{:suite "interop / numbers & classes" :label "Integer/toHexString wide" :expected "\"1234\"" :actual "(Integer/toHexString 4660)"}
|
|
{:suite "interop / numbers & classes" :label ".isNaN on a double" :expected "true" :actual "(.isNaN (/ 0.0 0.0))"}
|
|
{:suite "interop / numbers & classes" :label ".isInfinite on a double" :expected "true" :actual "(.isInfinite (/ 1.0 0.0))"}
|
|
{:suite "interop / numbers & classes" :label ".isNaN false for finite" :expected "false" :actual "(.isNaN 1.0)"}
|
|
{:suite "interop / numbers & classes" :label "protocol dispatch Long vs Double" :expected "[:l :d]" :actual "(do (defprotocol N (-n [x])) (extend java.lang.Long N {:-n (fn [_] :l)}) (extend java.lang.Double N {:-n (fn [_] :d)}) [(-n 5) (-n 5.0)])"}
|
|
{:suite "interop / numbers & classes" :label "instance? PushbackReader" :expected "true" :actual "(instance? java.io.PushbackReader (java.io.PushbackReader. (java.io.StringReader. \"x\")))"}
|
|
{:suite "interop / numbers & classes" :label "EOFException catch by class" :expected "\"boom\"" :actual "(try (throw (java.io.EOFException. \"boom\")) (catch java.io.EOFException e (.getMessage e)))"}
|
|
{:suite "interop / numbers & classes" :label "Reader.read into char[]" :expected "[4 \"abcd\"]" :actual "(let [r (java.io.StringReader. \"abcd\") b (char-array 4)] (let [n (.read r b 0 4)] [n (String. b 0 n)]))"}
|
|
{:suite "interop / java.time" :label "LocalDate toString" :expected "\"2020-01-15\"" :actual "(str (java.time.LocalDate/of 2020 1 15))"}
|
|
{:suite "interop / java.time" :label "LocalDate plusDays over leap day" :expected "\"2020-02-29\"" :actual "(str (.plusDays (java.time.LocalDate/of 2020 2 28) 1))"}
|
|
{:suite "interop / java.time" :label "LocalDate equality" :expected "true" :actual "(= (java.time.LocalDate/of 2020 1 15) (java.time.LocalDate/of 2020 1 15))"}
|
|
{:suite "interop / java.time" :label "LocalDate compare" :expected "-1" :actual "(compare (java.time.LocalDate/of 2020 1 15) (java.time.LocalDate/of 2020 1 16))"}
|
|
{:suite "interop / java.time" :label "LocalDate ofEpochDay round-trip" :expected "1" :actual "(.toEpochDay (java.time.LocalDate/of 1970 1 2))"}
|
|
{:suite "interop / java.time" :label "LocalDate parse" :expected "\"2020-01-15\"" :actual "(str (java.time.LocalDate/parse \"2020-01-15\"))"}
|
|
{:suite "interop / java.time" :label "LocalDate getDayOfWeek name" :expected "\"WEDNESDAY\"" :actual "(.name (.getDayOfWeek (java.time.LocalDate/of 2020 1 15)))"}
|
|
{:suite "interop / java.time" :label "LocalTime toString" :expected "\"10:30:15\"" :actual "(str (java.time.LocalTime/of 10 30 15))"}
|
|
{:suite "interop / java.time" :label "LocalTime plusHours wraps midnight" :expected "\"01:30\"" :actual "(str (.plusHours (java.time.LocalTime/of 23 30) 2))"}
|
|
{:suite "interop / java.time" :label "LocalDateTime toString" :expected "\"2020-01-15T10:30\"" :actual "(str (java.time.LocalDateTime/of 2020 1 15 10 30 0))"}
|
|
{:suite "interop / java.time" :label "Instant ofEpochMilli toString" :expected "\"2020-01-15T10:30:00Z\"" :actual "(str (java.time.Instant/ofEpochMilli 1579084200000))"}
|
|
{:suite "interop / java.time" :label "Instant ofEpochMilli round-trip" :expected "1579084200000" :actual "(.toEpochMilli (java.time.Instant/ofEpochMilli 1579084200000))"}
|
|
{:suite "interop / java.time" :label "Duration ofSeconds toString" :expected "\"PT1M30S\"" :actual "(str (java.time.Duration/ofSeconds 90))"}
|
|
{:suite "interop / java.time" :label "Duration between instants" :expected "\"PT1H1M1S\"" :actual "(str (java.time.Duration/between (java.time.Instant/ofEpochSecond 0) (java.time.Instant/ofEpochSecond 3661)))"}
|
|
{:suite "interop / java.time" :label "Period between dates" :expected "\"P1Y2M2D\"" :actual "(str (java.time.Period/between (java.time.LocalDate/of 2020 1 1) (java.time.LocalDate/of 2021 3 3)))"}
|
|
{:suite "interop / java.time" :label "Period parse round-trip" :expected "\"P1Y2M3D\"" :actual "(str (java.time.Period/parse \"P1Y2M3D\"))"}
|
|
{:suite "interop / java.time" :label "Period normalized" :expected "\"P2Y1M5D\"" :actual "(str (.normalized (java.time.Period/of 1 13 5)))"}
|
|
{:suite "interop / java.time" :label "Month of toString" :expected "\"FEBRUARY\"" :actual "(.toString (java.time.Month/of 2))"}
|
|
{:suite "interop / java.time" :label "Month length leap" :expected "29" :actual "(.length (java.time.Month/of 2) true)"}
|
|
{:suite "interop / java.time" :label "DayOfWeek constant prints name" :expected "\"MONDAY\"" :actual "(str java.time.DayOfWeek/MONDAY)"}
|
|
{:suite "interop / java.time" :label "YearMonth toString" :expected "\"2020-02\"" :actual "(str (java.time.YearMonth/of 2020 2))"}
|
|
{:suite "interop / java.time" :label "ChronoUnit DAYS between" :expected "14" :actual "(.between java.time.temporal.ChronoUnit/DAYS (java.time.LocalDate/of 2020 1 1) (java.time.LocalDate/of 2020 1 15))"}
|
|
{:suite "interop / java.time" :label "LocalDate plus ChronoUnit DAYS" :expected "\"2020-01-04\"" :actual "(str (.plus (java.time.LocalDate/of 2020 1 1) 3 java.time.temporal.ChronoUnit/DAYS))"}
|
|
{:suite "interop / java.time" :label "LocalDate until ChronoUnit DAYS" :expected "31" :actual "(.until (java.time.LocalDate/of 2020 1 1) (java.time.LocalDate/of 2020 2 1) java.time.temporal.ChronoUnit/DAYS)"}
|
|
{:suite "interop / java.time" :label "ZoneOffset ofHoursMinutes toString" :expected "\"+02:00\"" :actual "(str (java.time.ZoneOffset/ofHoursMinutes 2 0))"}
|
|
{:suite "interop / java.time" :label "ZoneOffset ofTotalSeconds toString" :expected "\"-04:30\"" :actual "(str (java.time.ZoneOffset/ofTotalSeconds -16200))"}
|
|
{:suite "interop / java.time" :label "ZoneOffset UTC toString" :expected "\"Z\"" :actual "(str java.time.ZoneOffset/UTC)"}
|
|
{:suite "interop / java.time" :label "ZoneOffset of getTotalSeconds" :expected "7200" :actual "(.getTotalSeconds (java.time.ZoneOffset/of \"+02:00\"))"}
|
|
{:suite "interop / java.time" :label "ZoneOffset ofHoursMinutes negative" :expected "\"-04:30\"" :actual "(.getId (java.time.ZoneOffset/ofHoursMinutes -4 -30))"}
|
|
{:suite "interop / java.time" :label "OffsetDateTime toInstant" :expected "\"2020-01-15T08:30:00Z\"" :actual "(str (.toInstant (java.time.OffsetDateTime/of 2020 1 15 10 30 0 0 (java.time.ZoneOffset/ofHours 2))))"}
|
|
{:suite "interop / java.time" :label "OffsetDateTime toString" :expected "\"2020-01-15T10:30+02:00\"" :actual "(str (java.time.OffsetDateTime/of 2020 1 15 10 30 0 0 (java.time.ZoneOffset/ofHours 2)))"}
|
|
{:suite "interop / java.time" :label "ZonedDateTime withZoneSameInstant UTC" :expected "\"2020-01-15T08:30Z\"" :actual "(str (.withZoneSameInstant (java.time.ZonedDateTime/parse \"2020-01-15T10:30:00+02:00[Europe/Paris]\") java.time.ZoneOffset/UTC))"}
|
|
{:suite "interop / java.time" :label "ZonedDateTime of toInstant fixed offset" :expected "\"2020-01-15T08:30:00Z\"" :actual "(str (.toInstant (java.time.ZonedDateTime/of 2020 1 15 10 30 0 0 (java.time.ZoneId/of \"+02:00\"))))"}
|
|
{:suite "interop / java.time" :label "DateTimeFormatter ofPattern format" :expected "\"2020-01-15 10:30:00\"" :actual "(.format (java.time.format.DateTimeFormatter/ofPattern \"yyyy-MM-dd HH:mm:ss\") (java.time.LocalDateTime/of 2020 1 15 10 30 0))"}
|
|
{:suite "interop / java.time" :label "ISO_LOCAL_DATE_TIME format" :expected "\"2020-01-15T10:30:00\"" :actual "(.format java.time.format.DateTimeFormatter/ISO_LOCAL_DATE_TIME (java.time.LocalDateTime/of 2020 1 15 10 30 0))"}
|
|
{:suite "interop / java.time" :label "ISO_OFFSET_DATE_TIME format" :expected "\"2020-01-15T10:30:00+02:00\"" :actual "(.format java.time.format.DateTimeFormatter/ISO_OFFSET_DATE_TIME (java.time.OffsetDateTime/of 2020 1 15 10 30 0 0 (java.time.ZoneOffset/ofHours 2)))"}
|
|
{:suite "interop / java.time" :label "Instant plusNanos toString nanos group" :expected "\"1970-01-01T00:00:00.000000001Z\"" :actual "(str (.plusNanos (java.time.Instant/ofEpochSecond 0) 1))"}
|
|
{:suite "interop / java.time" :label "Instant one nano differs" :expected "false" :actual "(= (java.time.Instant/ofEpochSecond 0) (.plusNanos (java.time.Instant/ofEpochSecond 0) 1))"}
|
|
{:suite "interop / java.time" :label "Instant getNano single nano" :expected "1" :actual "(.getNano (.plusNanos (java.time.Instant/ofEpochSecond 0) 1))"}
|
|
{:suite "interop / java.time" :label "Instant ofEpochSecond nano millis group" :expected "\"1970-01-01T00:00:00.001Z\"" :actual "(str (java.time.Instant/ofEpochSecond 0 1000000))"}
|
|
{:suite "interop / java.time" :label "Instant ofEpochSecond nano micros group" :expected "\"1970-01-01T00:00:00.000001Z\"" :actual "(str (java.time.Instant/ofEpochSecond 0 1000))"}
|
|
{:suite "interop / java.time" :label "Instant plusSeconds keeps nanos" :expected "\"1970-01-01T00:00:02.000000005Z\"" :actual "(str (.plusSeconds (.plusNanos (java.time.Instant/ofEpochSecond 0) 5) 2))"}
|
|
{:suite "interop / java.time" :label "Instant getEpochSecond floors negative nano" :expected "-1" :actual "(.getEpochSecond (.plusNanos (java.time.Instant/ofEpochSecond 0) -1))"}
|
|
{:suite "interop / java.time" :label "Instant getNano of negative nano" :expected "999999999" :actual "(.getNano (.plusNanos (java.time.Instant/ofEpochSecond 0) -1))"}
|
|
{:suite "interop / java.time" :label "Instant toEpochMilli floors sub-milli" :expected "1000" :actual "(.toEpochMilli (.plusNanos (java.time.Instant/ofEpochSecond 1) 999999))"}
|
|
{:suite "interop / java.time" :label "Instant truncatedTo SECONDS drops nanos" :expected "\"1970-01-01T00:00:05Z\"" :actual "(str (.truncatedTo (.plusNanos (java.time.Instant/ofEpochSecond 5) 123) java.time.temporal.ChronoUnit/SECONDS))"}
|
|
]
|