[plt-scheme] Why is testing not working?

From: Marco Morazan (morazanm at gmail.com)
Date: Wed Nov 12 15:38:33 EST 2008

Dear All,

I have a student who wrote the following code:

; Oldest Generation
(define Petrona (make-child empty empty 'Petrona 1876 'Brown))
(define Petr (make-child empty empty 'Petr 1896 'Brown))
(define Lena (make-child empty empty 'Lena 1896 'Brown))
; Second Oldest Generation
(define Jose (make-child empty Petrona 'Jose 1895 'Brown))
(define Marina (make-child empty empty 'Marina 1910 'Brown))
(define Walter (make-child empty empty 'Walter 1912 'Blue))
(define Helen (make-child Petr Lena 'Helen 1917 'Brown))
; Third Oldest Generation
(define Marco2 (make-child Jose Marina 'Marco 1934 'Brown))
(define Doris (make-child Walter Helen 'Doris 1935 'Brown))
; Youngest Generation
(define Marco (make-child Marco2 Doris 'Marco 1967 'Brown))

;numanc: at -> num
(define (numanc an-at)
  (cond [(empty? an-at) 0]
           [else (+ (parents an-at) (numanc (child-mother an-at))
(numanc (child-father an-at)))]))

; parents at -> num
          (define (parents an-at)
          (cond
            [(empty? an-at) 0]
            [(and (empty? (child-mother an-at))(empty? (child-father an-at))) 0]
            [(or (empty? (child-mother an-at))(empty? (child-father
an-at))) 1]
            [else 2]))

;examples

(check-expect (numanc Petrona) 0)
(check-expect (numanc Jose) 1)
(check-expect (numanc Marco2) 3)
(check-expect (numanc Marco) 9)


The output in the interactions window after hitting run is:

Welcome to DrScheme, version 4.1.2 [3m].
Language: Beginning Student with List Abbreviations; memory limit: 128
megabytes.
>

As you can see, no indication of tests passing. Any suggestions? We
uninstalled and re-installed DrScheme. We explictily added testing.ss.
All to no avail.

-- 

Cheers,

Marco


Posted on the users mailing list.