[plt-scheme] Re: [plt-edu] Why is testing not working?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Nov 12 17:32:37 EST 2008

I can't reproduce this result at all. I copied your code into an  
empty def window and added the define-struct. I get this in the  
interactions window:


> Welcome to DrScheme, version 4.1.2.4-svn11nov2008 [3m].
> Language: Intermediate Student with lambda.
> All tests passed!
> >

(Of course the tests don't cover everything and the code doesn't  
follow the design recipe. :-)

-- Matthias





On Nov 12, 2008, at 3:38 PM, Marco Morazan wrote:

> 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
> _________________________________________________
> PLT Educators mailing list
> plt-edu at list.cs.brown.edu
> http://list.cs.brown.edu/mailman/listinfo/plt-edu



Posted on the users mailing list.