diff --git a/test/propeller/push/instructions/string_spec.clj b/test/propeller/push/instructions/string_spec.clj index 7f5b76d..dd4c803 100644 --- a/test/propeller/push/instructions/string_spec.clj +++ b/test/propeller/push/instructions/string_spec.clj @@ -25,3 +25,19 @@ (check-butlast s))) +;; string/concat + +(defn check-concat + [value1 value2] + (let [start-state (-> state/empty-state + (state/push-to-stack :string value1) + (state/push-to-stack :string value2)) + end-state ((:string_concat @core/instruction-table) start-state) + expected-result (str value1 value2)] + (= expected-result + (state/peek-stack end-state :string)))) + +(defspec concat-spec 100 + (prop/for-all [s1 gen/string + s2 gen/string] + (check-concat s1 s2))) \ No newline at end of file