What does it do? Does `check-equal?` show a failure message? If so,
what does it say?


I don't know what `refine-main` does, but this simple version works for me:

#lang racket

(require rackunit)

(define (refine-main)
  (display (read-line))) ;echo

(check-equal?
 (with-output-to-string
   (lambda ()
     (with-input-from-string "input"
       (lambda ()
         (refine-main)))))
 "input")

On Sun, Feb 17, 2019 at 12:35 AM Joao Pedro Abreu De Souza
<[email protected]> wrote:
>
> Hi everyone. I have a test of a user-related function that I don't can see 
> why don't work :
>
> #lang racket
>
> (require rackunit)
> (require "../../main.rkt")
>
>
>
>
> (check-equal?
> (with-output-to-string (lambda ()
> (with-input-from-string
> "exit 0"
> (lambda () (refine-main)))))
> ""
> "Consigo sair antes de comecar o tutorial")
>
>
>
>
> I think that this will call refine-main and, when refine-main do a readline, 
> will receive "exit 0" as string, and when display something, will appear as 
> return of with-output-to-string, but this code don't work :(
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to