Liking cljdoc? Tell your friends :D

hara.test.checker.collection


containsclj

(contains x & modifiers)

checker for maps and vectors

((contains {:a odd? :b even?}) {:a 1 :b 4}) => true

((contains {:a 1 :b even?}) {:a 2 :b 4}) => false

((contains [1 2 3]) [1 2 3 4]) => true

((contains [1 3]) [1 2 3 4]) => false

checker for maps and vectors

((contains {:a odd? :b even?}) {:a 1 :b 4})
=> true

((contains {:a 1 :b even?}) {:a 2 :b 4})
=> false

((contains [1 2 3]) [1 2 3 4])
=> true

((contains [1 3]) [1 2 3 4])
=> false

raw docstring

contains-incljmacro

(contains-in x)

shorthand for checking nested maps and vectors

((contains-in {:a {:b {:c odd?}}}) {:a {:b {:c 1 :d 2}}}) => true

((contains-in [odd? {:a {:b even?}}]) [3 {:a {:b 4 :c 5}}]) => true

shorthand for checking nested maps and vectors

((contains-in {:a {:b {:c odd?}}}) {:a {:b {:c 1 :d 2}}})
=> true

((contains-in [odd? {:a {:b even?}}]) [3 {:a {:b 4 :c 5}}])
=> true
raw docstring

contains-mapclj

(contains-map x)

map check helper function for contains

map check helper function for `contains`
raw docstring

contains-setclj

(contains-set x)

set check helper function for contains

((contains-set #{1 2 3}) [1 2 3 4 5]) => true

((contains-set #{1 2 4}) [1 2 3 4 5]) => false

set check helper function for `contains`

((contains-set #{1 2 3}) [1 2 3 4 5])
=> true

((contains-set #{1 2 4}) [1 2 3 4 5])
=> false
raw docstring

contains-vectorclj

(contains-vector x)
(contains-vector x modifiers)

vector check helper function for contains

vector check helper function for `contains`
raw docstring

justclj

(just x & modifiers)

combination checker for both maps and vectors

((just {:a odd? :b even?}) {:a 1 :b 4}) => true

((just {:a 1 :b even?}) {:a 1 :b 2 :c 3}) => false

((just [1 2 3 4]) [1 2 3 4]) => true

((just [1 2 3]) [1 2 3 4]) => false

((just [3 2 4 1] :in-any-order) [1 2 3 4]) => true

combination checker for both maps and vectors

((just {:a odd? :b even?}) {:a 1 :b 4})
=> true

((just {:a 1 :b even?}) {:a 1 :b 2 :c 3})
=> false

((just [1 2 3 4]) [1 2 3 4])
=> true

((just [1 2 3]) [1 2 3 4])
=> false

((just [3 2 4 1] :in-any-order) [1 2 3 4])
=> true
raw docstring

just-incljmacro

(just-in x)

shorthand for exactly checking nested maps and vectors

((just-in {:a {:b {:c odd?}}}) {:a {:b {:c 1 :d 2}}}) => false

((just-in [odd? {:a {:b even?}}]) [3 {:a {:b 4}}])

((just-in [odd? {:a {:b even?}}]) [3 {:a {:b 4}}]) => true

shorthand for exactly checking nested maps and vectors

((just-in {:a {:b {:c odd?}}}) {:a {:b {:c 1 :d 2}}})
=> false

((just-in [odd? {:a {:b even?}}]) [3 {:a {:b 4}}])

((just-in [odd? {:a {:b even?}}]) [3 {:a {:b 4}}])
=> true
raw docstring

just-mapclj

(just-map x)

map check helper function for just

map check helper function for `just`
raw docstring

just-setclj

(just-set x)

set check helper function for just

((just-set #{1 2 3}) [1 2 3]) => true

set check helper function for `just`

((just-set #{1 2 3}) [1 2 3])
=> true
raw docstring

just-vectorclj

(just-vector x)
(just-vector x modifiers)

vector check helper function for just

vector check helper function for `just`
raw docstring

throws-infoclj

(throws-info)
(throws-info m)

checker that determines if an ex-info has been thrown

((throws-info {:a "hello" :b "there"}) (common/evaluate {:form '(throw (ex-info "hello" {:a "hello" :b "there"}))})) => true

checker that determines if an `ex-info` has been thrown

((throws-info {:a "hello" :b "there"})
 (common/evaluate {:form '(throw (ex-info "hello" {:a "hello" :b "there"}))}))
=> true
raw docstring

verify-mapclj

(verify-map ck data)

takes two maps and determines if they fit (verify-map {:a (base/satisfies odd?) :b (base/satisfies even?)} {:a 1 :b 2}) => true

takes two maps and determines if they fit
(verify-map {:a (base/satisfies odd?)
             :b (base/satisfies even?)}
            {:a 1 :b 2})
=> true
raw docstring

verify-seqclj

(verify-seq ck data modifiers)

takes two seqs and determines if they fit (verify-seq [(base/satisfies 1) (base/satisfies 2)] [2 1] #{:in-any-order}) => true

(verify-seq [(base/satisfies 1) (base/satisfies 2)] [2 3 1] #{:in-any-order :gaps-ok}) => true

takes two seqs and determines if they fit
(verify-seq [(base/satisfies 1) (base/satisfies 2)]
            [2 1]
            #{:in-any-order})
=> true

(verify-seq [(base/satisfies 1) (base/satisfies 2)]
            [2 3 1]
            #{:in-any-order :gaps-ok})
=> true
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close