run / wrapped stuff
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 19 Nov 2015 18:51:46 +0000 (12:51 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 19 Nov 2015 18:51:46 +0000 (12:51 -0600)
tests.scm

index 84bf8f35b32e3f1ae0b69e266622e09d1bdad3b4..b865ca809bb728c6798db8a25b1e3e9bc6fa9cdc 100644 (file)
--- a/tests.scm
+++ b/tests.scm
 
 ;; ... 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")