diff --git a/test/propeller/push/instructions/string_spec.clj b/test/propeller/push/instructions/string_spec.clj index 493f087..50ea2de 100644 --- a/test/propeller/push/instructions/string_spec.clj +++ b/test/propeller/push/instructions/string_spec.clj @@ -96,9 +96,21 @@ (prop/for-all [str gen/string char gen/char] (check-contains-char str char))) + + +;; string/drop + +(defn check-drop + [value n] + (let [start-state (-> state/empty-state + (state/push-to-stack :string value) + (state/push-to-stack :integer n)) + end-state ((:string_drop @core/instruction-table) start-state) + expected-result (apply str (drop n value))] + (= expected-result (state/peek-stack end-state :string)))) -(defspec contains-char-spec 100 +(defspec drop-spec 100 (prop/for-all [str gen/string - char gen/string] - (check-concat str char))) \ No newline at end of file + int gen/small-integer] + (check-drop str int))) \ No newline at end of file