diff --git a/test/propeller/push/instructions/string_spec.clj b/test/propeller/push/instructions/string_spec.clj index 363f4fa..07c9f48 100644 --- a/test/propeller/push/instructions/string_spec.clj +++ b/test/propeller/push/instructions/string_spec.clj @@ -231,4 +231,19 @@ (defspec indexof-char-spec 100 (prop/for-all [str gen/string char gen/char] - (check-indexof-char str char))) \ No newline at end of file + (check-indexof-char str char))) + + +;; string/last + +(defn check-last + [value] + (let [start-state (state/push-to-stack state/empty-state :string value) + end-state ((:string_last @core/instruction-table) start-state) + expected-result (last value)] + (= expected-result + (state/peek-stack end-state :char)))) + +(defspec last-spec 100 + (prop/for-all [str gen/string] + (check-last str))) \ No newline at end of file