agenda: Cut out huge swath of old 8sync-* procedures/macros.
[8sync.git] / tests / test-agenda.scm
index 59c27b7ef21677431766f842b1940d43cb486373..8d5b5242a3e3ae481a21a521090f1256756449dc 100644 (file)
 ;;; %run, 8sync and friends tests
 ;;; ==============================
 
-(define-syntax-rule (run-in-fake-agenda
-                     code-to-run)
-  (let ((agenda (make-agenda)))
-    (parameterize ((%current-agenda agenda))
-      (call-with-prompt
-       (agenda-prompt-tag agenda)
-       (lambda ()
-         (list '*normal-result* code-to-run))
-       (lambda (kont async-request)
-         (list '*caught-kont*
-               kont async-request
-               ((@@ (8sync agenda) setup-async-request)
-                kont async-request)))))))
-
-(define (test-%run-and-friends run-result expected-when)
-  (match run-result
-    (('*caught-kont* kont async-request setup-request)
-     (let* ((fake-kont (speak-it))
-            (run-request ((@@ (8sync agenda) setup-async-request)
-                          fake-kont async-request)))
-       (test-equal (car async-request) '*async-request*)
-       (test-equal (run-request-when run-request) expected-when)
-       ;; we're using speaker as a fake continuation ;p
-       ((run-request-proc run-request))
-       (test-equal (fake-kont)
-                   '("applesauce"))))))
-
-(test-%run-and-friends (run-in-fake-agenda
-                        (8sync-delay (string-concatenate '("apple" "sauce"))
-                                      8))
-                       ;; whoa, I'm surprised equal? can
-                       ;; compare records like this
-                       (tdelta 8))
-
-;; TODO: test 8sync and friends!
-
+;; TODO: We need to rewrite the whole lot here...
 
 ;;; Agenda tests
 ;;; ============