diff --git a/test/propeller/push/instructions/string_spec.clj b/test/propeller/push/instructions/string_spec.clj index 64707c6..30c738c 100644 --- a/test/propeller/push/instructions/string_spec.clj +++ b/test/propeller/push/instructions/string_spec.clj @@ -444,3 +444,18 @@ (defspec rest-spec 100 (prop/for-all [str gen/string] (check-rest str))) + + +;; string/reverse + +(defn check-reverse + [value] + (let [start-state (state/push-to-stack state/empty-state :string value) + end-state ((:string_reverse @core/instruction-table) start-state) + expected-result (apply str (reverse value))] + (= expected-result + (state/peek-stack end-state :string)))) + +(defspec reverse-spec 100 + (prop/for-all [str gen/string] + (check-reverse str))) \ No newline at end of file