From 8afa8f83e555c8b7ceb6d6ff3781c0d85626b87e Mon Sep 17 00:00:00 2001 From: Erik Rauer Date: Tue, 5 Jan 2021 14:49:54 -0600 Subject: [PATCH] Add tests for `vector/_rest` This adds tests for `vector/_rest`. --- test/propeller/push/instructions/vector_spec.clj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/propeller/push/instructions/vector_spec.clj b/test/propeller/push/instructions/vector_spec.clj index 50c2102..c0000a0 100644 --- a/test/propeller/push/instructions/vector_spec.clj +++ b/test/propeller/push/instructions/vector_spec.clj @@ -338,6 +338,21 @@ (gen-specs "replacefirst" check-replacefirst :vector :item :item) +;;; vector/_rest + +(defn check-rest + [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/_rest stack-type start-state) + expected-result (vec (rest vect))] + (= expected-result + (state/peek-stack end-state stack-type)))) + +(gen-specs "rest" check-rest :vector) + ;;; vector/_subvec (defn clean-subvec-bounds