Add tests for vector/_pushall

This adds tests for `vector/_pushall`.
This commit is contained in:
Erik Rauer 2020-12-30 14:47:29 -06:00
parent aa2ed597a1
commit f71760c08f

View File

@ -251,6 +251,27 @@
(gen-specs "occurrencesof" check-occurrencesof :vector :item)
;;; vector/_pushall
(defn check-pushall
[value-type vect]
(let [stack-type (keyword (str "vector_" value-type))
start-state (state/push-to-stack state/empty-state
stack-type
vect)
end-state (vector/_pushall stack-type start-state)
value-stack (keyword value-type)
vect-length (count vect)]
(and
(=
(vec (state/peek-stack-many end-state value-stack vect-length))
vect)
(state/empty-stack?
(state/pop-stack-many end-state value-stack vect-length)
value-stack))))
(gen-specs "pushall" check-pushall :vector)
;;; vector/_subvec
(defn clean-subvec-bounds