Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
WOW. I finish read the doc about #:final That is so beatiful thing. Thank you to you three Em dom, 17 de fev de 2019 às 22:18, Joao Pedro Abreu De Souza < jp_ab...@id.uff.br> escreveu: > Thanks for the feedback! > I will study this code and make more functional > > Em dom, 17 de fev de 2019

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
Thanks for the feedback! I will study this code and make more functional Em dom, 17 de fev de 2019 22:13, Philip McGrath Well, if you call `(exit 0)`, your Racket program really will exit with > code 0 without doing anything else: the function `exit` never returns, so, > in your case, `execute`

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Philip McGrath
Well, if you call `(exit 0)`, your Racket program really will exit with code 0 without doing anything else: the function `exit` never returns, so, in your case, `execute` never returns, `refine-main` never returns, and Rackunit never gets a chance to look at any output it may or may not have

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
Thanks a lot. Sorry about the simple error. Em dom, 17 de fev de 2019 22:06, Matthias Felleisen > > On Feb 17, 2019, at 6:44 PM, Joao Pedro Abreu De Souza > wrote: > > (check-equal? > (with-output-to-string >(lambda () > (with-input-from-string "input" >(lambda () >

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Matthias Felleisen
> On Feb 17, 2019, at 6:44 PM, Joao Pedro Abreu De Souza > wrote: > > (check-equal? > (with-output-to-string >(lambda () > (with-input-from-string "input" >(lambda () > (refine-main) Your mistake is in the above line. You want to write refine-main not

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
(define (refine-main) (display next-string) ;;feito (set! next-command (shell-parser (my-read-line))) ;;TODO my-read-line (execute next-command) ;;TODO execute (refine-main)) ;;feito This is refine-main "shell-parser" is just a PEG-based parser, that return a

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
Well, there's no imediate return, i need to type exit 0 to finally the test works I am using read-line to read input. Today later I will post more code(of refine-main). Thanks Em dom, 17 de fev de 2019 10:37, Greg Hendershott What does it do? Does `check-equal?` show a failure message? If so,

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Greg Hendershott
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

[racket-users] test user-interact function dont work

2019-02-16 Thread Joao Pedro Abreu De Souza
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