foldts-test-suite

52 views
Skip to first unread message

Shriram Krishnamurthi

unread,
May 23, 2020, 10:52:21 AM5/23/20
to Racket Users
The documentation


says that `folds-test-suite` can be implemented in terms of `fold-test-results` as follows:

(define (fold-test-results suite-fn case-fn seed test)
  (foldts-test-suite
   (lambda (suite name before after seed)
     (before)
     (suite-fn name seed))
   (lambda (suite name before after seed kid-seed)
     (after)
     kid-seed)
   (lambda (case name action seed)
     (case-fn
       (run-test-case name action)
       seed))
   seed
   test))

I'm curious why the value of `seed` in the second argument (the fup position) — highlighted — is ignored. I was guessing that, since this is a tree-fold, there are values "from across" and "from down", and we don't want to throw either one away. Wouldn't we want to take a combinator that combines the two?

Shriram

Jack Firth

unread,
Jun 2, 2020, 2:00:02 PM6/2/20
to Racket Users
The test case folding stuff in RackUnit should mostly be ignored, instead of extended.

Alex Harsanyi

unread,
Jun 2, 2020, 9:37:17 PM6/2/20
to Racket Users

Are there alternatives to the `folds-test-suite` and `fold-test-results` functions, for people who want to write their own test running and reporting for Rackunit tests?

Alex.

Jack Firth

unread,
Jun 3, 2020, 4:01:03 AM6/3/20
to Racket Users
Nope. A well-designed replacement for those APIs is sorely needed.
Reply all
Reply to author
Forward
0 new messages