From: Christopher Allan Webber Date: Thu, 19 Nov 2015 18:51:46 +0000 (-0600) Subject: run / wrapped stuff X-Git-Tag: v0.1.0~157 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=e0499fb27f966a6c81679e9d83260164197e5ff7;p=8sync.git run / wrapped stuff --- diff --git a/tests.scm b/tests.scm index 84bf8f3..b865ca8 100644 --- a/tests.scm +++ b/tests.scm @@ -152,6 +152,44 @@ ;; ... whew! +;; Run/wrap request stuff +;; ---------------------- + +(let ((wrapped (wrap (+ 1 2)))) + (test-assert (procedure? wrapped)) + (test-equal (wrapped) 3)) + +(let ((run-two-squared (run (lambda () (* 2 2))))) + (test-assert (run-request? run-two-squared)) + (test-assert (procedure? (run-request-proc run-two-squared))) + (test-equal ((run-request-proc run-two-squared)) 4) + (test-eq (run-request-when run-two-squared) #f)) + +(let ((run-two-squared (run (lambda () (* 2 2)) '(88 . 0)))) + (test-assert (run-request? run-two-squared)) + (test-assert (procedure? (run-request-proc run-two-squared))) + (test-equal ((run-request-proc run-two-squared)) 4) + (test-equal (run-request-when run-two-squared) '(88 . 0))) + +(let ((run-two-squared (run-wrap (* 2 2)))) + (test-assert (run-request? run-two-squared)) + (test-assert (procedure? (run-request-proc run-two-squared))) + (test-equal ((run-request-proc run-two-squared)) 4) + (test-eq (run-request-when run-two-squared) #f)) + +(let ((run-two-squared (run-wrap-at (* 2 2) '(88 . 0)))) + (test-assert (run-request? run-two-squared)) + (test-assert (procedure? (run-request-proc run-two-squared))) + (test-equal ((run-request-proc run-two-squared)) 4) + (test-equal (run-request-when run-two-squared) '(88 . 0))) + + +;; Agenda tests +;; ------------ + + + + ;; End tests (test-end "tests")