(defpackage :testiere.examples (:use #:cl) (:import-from #:testiere #:defun/t)) (in-package :testiere.examples) (defun/t fibble (x y &key (z 10)) "Hey, a docstring." :tests (= (1 2) 13) (>= (1 2 :z 1) -5) (:outputp (0 10 :z 0) (lambda (result) (equalp result 10))) (:fails ("strings" "ain't" :z "numbers")) :end (+ x y z)) (defvar *count*) (defun/t increment-count () "Increments the *count* variable." :tests (:with-bindings ((*count* 4)) (:afterp () (lambda () (= *count* 5))) (= () 6) (:outputp () (lambda (x) (= x 7)))) :end (incf *count*)) (defun/t other-increment-count (&optional (amount 1)) "Also increments the *count* variable by an optional amount." :tests (:with-bindings ((*count* 10)) (= () 11)) (:with-bindings ((*count* 0)) (= (10) 10) (:afterp (2) (lambda () (= *count* 12)))) :end (incf *count* amount)) (defun just-a-function () (print "Just a function.")) (defun/t call-just-a-function () "Calls JUST-A-FUNCTION." :tests (:with-stubs ((just-a-function () (print "TEMP JUST-A-FUNCTION."))) (equal () "TEMP JUST-A-FUNCTION.")) :end (just-a-function))