From 94d421ef0ac7b9ff51c765c3a99bb3c6d1adae12 Mon Sep 17 00:00:00 2001 From: Erik Rauer Date: Sun, 3 Jan 2021 16:17:09 -0600 Subject: [PATCH] Add tests for `vector/_remove` This adds tests for `vector/_remove`. --- .../propeller/push/instructions/vector_spec.clj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/propeller/push/instructions/vector_spec.clj b/test/propeller/push/instructions/vector_spec.clj index 6e6bad5..46230a2 100644 --- a/test/propeller/push/instructions/vector_spec.clj +++ b/test/propeller/push/instructions/vector_spec.clj @@ -272,6 +272,23 @@ (gen-specs "pushall" check-pushall :vector) +;;; vector/_remove + +(defn check-remove + [value-type vect value] + (let [stack-type (keyword (str "vector_" value-type)) + start-state (state/push-to-stack + (state/push-to-stack state/empty-state + stack-type + vect) + (keyword value-type) + value) + end-state (vector/_remove stack-type start-state)] + (= [] + (filterv #(= % value) (state/peek-stack end-state stack-type))))) + +(gen-specs "remove" check-remove :vector :item) + ;;; vector/_subvec (defn clean-subvec-bounds