Add tests for vector/_butlast
This adds tests for `vector/_butlast`.
This commit is contained in:
parent
957af4fc06
commit
5e87478ceb
@ -42,6 +42,21 @@
|
|||||||
arg-types)]
|
arg-types)]
|
||||||
(~check-fn ~value-type ~@symbol-names)))))))
|
(~check-fn ~value-type ~@symbol-names)))))))
|
||||||
|
|
||||||
|
;;; vector/_butlast
|
||||||
|
|
||||||
|
(defn check-butlast
|
||||||
|
[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/_butlast stack-type start-state)
|
||||||
|
expected-result (vec (butlast vect))]
|
||||||
|
(= expected-result
|
||||||
|
(state/peek-stack end-state stack-type))))
|
||||||
|
|
||||||
|
(gen-specs "butlast" check-butlast :vector)
|
||||||
|
|
||||||
;;; vector/_contains
|
;;; vector/_contains
|
||||||
|
|
||||||
(defn check-contains
|
(defn check-contains
|
||||||
|
Loading…
x
Reference in New Issue
Block a user