Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket/base
- (require racket/system racket/string)
- (define (main)
- (define args (vector->list (current-command-line-arguments)))
- (define command (string-join args " "))
- (define proc (process command))
- (define repl-out (car proc))
- (define repl-in (cadr proc))
- (define err (cadddr proc))
- (define repl (car (cddddr proc)))
- (define input "((lambda (x) x) 123)")
- (define expected "123")
- (display input repl-in)
- (newline repl-in)
- (flush-output repl-in)
- (display (repl 'status))
- (newline)
- (define actual (read-line repl-out))
- (if (equal? actual expected)
- (printf "Success! (~a)" actual)
- (printf "Failure! (~a)" actual))
- (newline)
- (display (repl 'status))
- (newline)
- (close-input-port repl-out)
- (close-input-port err)
- (close-output-port repl-in)
- (repl 'wait))
- (main)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement