Created
November 9, 2019 15:53
-
-
Save MiyamonY/7e79d6ba512c761f39bbd3055934f15d to your computer and use it in GitHub Desktop.
racket output port as string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require racket/port) | |
(define (output-string) | |
(with-output-to-string | |
(thunk (displayln "ok")))) | |
(module+ test | |
(require rackunit) | |
(check-equal? (output-string) "ok\n")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment