foldts-test-suite

52 vistas
Ir al primer mensaje no leído

Shriram Krishnamurthi

no leída,
23 may 2020, 10:52:21 a.m.23/5/2020
para 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

no leída,
2 jun 2020, 2:00:02 p.m.2/6/2020
para Racket Users
The test case folding stuff in RackUnit should mostly be ignored, instead of extended.

Alex Harsanyi

no leída,
2 jun 2020, 9:37:17 p.m.2/6/2020
para 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

no leída,
3 jun 2020, 4:01:03 a.m.3/6/2020
para Racket Users
Nope. A well-designed replacement for those APIs is sorely needed.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos