code.test.checker.util

contains-all

added in 3.0

(contains-all seq pattern)

checks if a sequence matches any of the checks (contains-all 0 1 2 3(map checker/->checker 2 1 3)) => true

(contains-all 0 1 2 3(map checker/->checker 2 0 3)) => true

(contains-all 0 1 2 3(map checker/->checker 0 0)) => false

contains-any-order

added in 3.0

(contains-any-order seq pattern)

checks if a sequence matches the pattern, with any order allowed (contains-any-order 0 1 2 3(map checker/->checker 2 1 3)) => true

(contains-any-order 0 1 2 3(map checker/->checker 2 0 3)) => false

contains-exact

added in 3.0

(contains-exact seq pattern)

checks if a sequence matches exactly (contains-exact 0 1 2 3(map checker/->checker 1 2 3)) => true

(contains-exact 0 1 2 3(map checker/->checker 1 3)) => false

contains-with-gaps

added in 3.0

(contains-with-gaps seq pattern)

checks if a sequence matches the pattern, with gaps allowed (contains-with-gaps 0 1 2 3(map checker/->checker 1 2 3)) => true

(contains-with-gaps 0 1 2 3(map checker/->checker 1 3)) => true

(contains-with-gaps 0 1 2 3(map checker/->checker 2 0)) => false

perm-build

added in 3.0

(perm-build seq pattern)

builds a perm out of a sequence and checks (perm-build 0 1 2 3(map checker/->checker 1 3)) => #{} #{0} #{} #{1}

(perm-build 0 1 2 3(map checker/->checker odd? 3 number?)) => #{2} #{0 2} #{2} #{0 1 2}

perm-check

added in 3.0

(perm-check perm all)(perm-check perm all selection)

decide if a given vector of perms are appropriately matched (perm-check #{0 1 2} #{2} #{0 2} #{0 1 2}) => true

(perm-check #{2} #{0 1 2} #{2} #{0 1 2}) => false

(perm-check #{1} #{1 0} #{0 2 1} #{1 0} #{0 2 1} #{0 1 2}) => true