(-main & args)
main entry point for leiningen
(-main)
main entry point for leiningen (-main)
(all & cks)
checker that allows and
composition of checkers
(mapv (all even? #(< 3 %)) [1 2 3 4 5]) => [false false false true false]
checker that allows `and` composition of checkers (mapv (all even? #(< 3 %)) [1 2 3 4 5]) => [false false false true false]
(any & cks)
checker that allows or
composition of checkers
(mapv (any even? 1) [1 2 3 4 5]) => [true true false true false]
checker that allows `or` composition of checkers (mapv (any even? 1) [1 2 3 4 5]) => [true true false true false]
(anything x)
a checker that returns true for any value
(anything nil) => true
(anything [:hello :world]) => true
a checker that returns true for any value (anything nil) => true (anything [:hello :world]) => true
(approx v)
(approx v threshold)
checker that allows approximate verifications
((approx 1) 1.000001) => true
((approx 1) 1.1) => false
((approx 1 0.0000001) 1.001) => false
checker that allows approximate verifications ((approx 1) 1.000001) => true ((approx 1) 1.1) => false ((approx 1 0.0000001) 1.001) => false
(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
(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
(exactly v)
(exactly v function)
checker that allows exact verifications
((exactly 1) 1) => true
((exactly Long) 1) => false
((exactly number?) 1) => false
checker that allows exact verifications ((exactly 1) 1) => true ((exactly Long) 1) => false ((exactly number?) 1) => false
(fact & [desc? & body])
top level macro for test definitions
top level macro for test definitions
(facts & more)
top level macro for test definitions
top level macro for test definitions
(is-not ck)
(is-not ck function)
checker that allows negative composition of checkers
(mapv (is-not even?) [1 2 3 4 5]) => [true false true false true]
checker that allows negative composition of checkers (mapv (is-not even?) [1 2 3 4 5]) => [true false true false true]
(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
(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
(print-options)
(print-options opts)
output options for test results
(print-options) => #{:disable :default :all :current :help}
(print-options :default) => #{:print-bulk :print-failure :print-thrown}
output options for test results (print-options) => #{:disable :default :all :current :help} (print-options :default) => #{:print-bulk :print-failure :print-thrown}
(process-args args)
processes input arguments
(process-args ["hello"]) => #{:hello}
processes input arguments (process-args ["hello"]) => #{:hello}
(run)
(run ns)
(run ns params)
(run ns params project)
(run ns params lookup project)
runs all tests
(run :list)
(run 'hara.core.base.util) ;; {:files 1, :thrown 0, :facts 8, :checks 18, :passed 18, :failed 0} => map?
runs all tests (run :list) (run 'hara.core.base.util) ;; {:files 1, :thrown 0, :facts 8, :checks 18, :passed 18, :failed 0} => map?
(run-errored)
runs only the tests that have errored
(run-errored)
runs only the tests that have errored (run-errored)
(satisfies v)
(satisfies v function)
checker that allows loose verifications
((satisfies 1) 1) => true
((satisfies Long) 1) => true
((satisfies number?) 1) => true
((satisfies #{1 2 3}) 1) => true
((satisfies [1 2 3]) 1) => false
((satisfies number?) "e") => false
((satisfies #"hello") #"hello") => true
checker that allows loose verifications ((satisfies 1) 1) => true ((satisfies Long) 1) => true ((satisfies number?) 1) => true ((satisfies #{1 2 3}) 1) => true ((satisfies [1 2 3]) 1) => false ((satisfies number?) "e") => false ((satisfies #"hello") #"hello") => true
(throws)
(throws e)
(throws e msg)
checker that determines if an exception has been thrown
((throws Exception "Hello There") (result/map->Result {:status :exception :data (Exception. "Hello There")})) => true
checker that determines if an exception has been thrown ((throws Exception "Hello There") (result/map->Result {:status :exception :data (Exception. "Hello There")})) => true
(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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close