Add simple-check based roundtrip test
This commit is contained in:
parent
42b366a432
commit
557cf2eda7
1 changed files with 6 additions and 1 deletions
|
|
@ -27,6 +27,11 @@
|
||||||
:password [:salted "p"]}))
|
:password [:salted "p"]}))
|
||||||
test-data))
|
test-data))
|
||||||
|
|
||||||
|
(expect ; Try roundtrip anything that simple-check can dream up
|
||||||
|
(:result (sc/quick-check 80 ; Time is n-non-linear
|
||||||
|
(sc-prop/for-all [val sc-gen/any]
|
||||||
|
(= val (nippy/thaw (nippy/freeze val)))))))
|
||||||
|
|
||||||
(expect AssertionError (thaw (freeze test-data {:password "malformed"})))
|
(expect AssertionError (thaw (freeze test-data {:password "malformed"})))
|
||||||
(expect Exception (thaw (freeze test-data {:password [:salted "p"]})))
|
(expect Exception (thaw (freeze test-data {:password [:salted "p"]})))
|
||||||
(expect Exception (thaw (freeze test-data {:password [:salted "p"]})
|
(expect Exception (thaw (freeze test-data {:password [:salted "p"]})
|
||||||
|
|
@ -105,7 +110,7 @@
|
||||||
(let [{:keys [result bin->val val->bin]} (qc-prop-bijection 10)]
|
(let [{:keys [result bin->val val->bin]} (qc-prop-bijection 10)]
|
||||||
[result (vals bin->val)]))
|
[result (vals bin->val)]))
|
||||||
|
|
||||||
;; (expect #(:result %) (qc-prop-bijection 120)) ; Time seems to be n-non-linear
|
;; (expect #(:result %) (qc-prop-bijection 120)) ; Time is n-non-linear
|
||||||
(expect #(:result %) (qc-prop-bijection 80))
|
(expect #(:result %) (qc-prop-bijection 80))
|
||||||
|
|
||||||
;;;; Benchmarks
|
;;;; Benchmarks
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue