reset password
Author Message
layla08
Posts: 70
Posted 19:54 Oct 16, 2015 |

When I run my rackunit tests, the Failures show up as expected, but I also see several  lines of #<procedure:>>. What produces this and is it normal to see this during a test? Thanks!

Welcome to DrRacket, version 6.2.1 [3m].
Language: racket; memory limit: 128 MB.
#<procedure:>>
#<procedure:>>
--------------------
FAILURE
actual:     #f
expected:   #t
name:       check-equal?
location:   (unsaved-editor 10 2 360 49)
expression: (check-equal? (is-a-palindrome? '(1 2 2 2 2)) #t)

. . Check failure
--------------------
#<procedure:>>
#<procedure:>>
#<procedure:>>
--------------------
FAILURE
actual:     #t
expected:   #f
name:       check-equal?
location:   (unsaved-editor 13 2 612 49)
expression: (check-equal? (is-a-palindrome? '(1 2 z 2 1)) #f)

. . Check failure
--------------------

vsluong4
Posts: 87
Posted 20:34 Oct 16, 2015 |

A procedure in Racket is a function

That output means that something in your code is returning a function and the console is just outputting it, because the console just outputs anything that is returned

 

More specifically, it looks like > is the function that is being returned

layla08
Posts: 70
Posted 12:50 Oct 17, 2015 |

Thanks for your response! 

Everything works in the Interactions panel (there is no output if the test passes, but there is a failure report if it doesn't pass), but I'm still unsure of why a function is being returned when I write a check-equal? in the Definitions panel. 

When I run my rackunit, shouldn't it also behave the same and only produce the failures? Is it okay to get #<procedure:> back at all? It doesn't seem like it should.

Last edited by layla08 at 12:53 Oct 17, 2015.
giraid
Posts: 39
Posted 20:02 Oct 18, 2015 |

This does not answer your question. But I dont think you are using rackunit test the way it is intended. You should check your function against the expected result. In your case, you should check it against #f instead of #t.

layla08
Posts: 70
Posted 20:16 Oct 18, 2015 |

Problem solved. The answer was no, it shouldn't produce any <procedures>. I had an extra symbol that was messing everything up. The output should be completely empty if the tests are all passed, and there should be a failure report if a test doesn't pass. 

Thanks for your help everyone.

Last edited by layla08 at 21:21 Oct 18, 2015.