39 lines
1.4 KiB
Scheme
39 lines
1.4 KiB
Scheme
(define-module (tests test-wrap)
|
||
#:use-module (reflow wrap)
|
||
#:use-module (tests utils)
|
||
#:use-module (srfi srfi-64)
|
||
#:use-module (rnrs io ports))
|
||
|
||
(test-begin "test-wrap")
|
||
|
||
(verify-output
|
||
"hello ther\ne \x1b[3mHowdy! H\n\x1b[3mow are you\n\x1b[3m? \x1b[0mThis is \nfun, \x1b[5misn't\n\x1b[5m it tho?\x1b[0m\n I disa\ngree. I fi\nnd it \x1b[2mtedi\n\x1b[2mous\n"
|
||
(define port
|
||
(make-wrapping-port (current-output-port) 10 #:preserve-space? #t))
|
||
(display
|
||
"hello there \x1b[3mHowdy! How are you? \x1b[0mThis is fun, \x1b[5misn't it tho?\x1b[0m\n\tI disagree. I find it \x1b[2mtedious\n"
|
||
port))
|
||
|
||
;; Trans Rights 🏳️⚧️ Are Human Rights
|
||
;; But spiced up with bold and italic
|
||
;; Should look like
|
||
;; Trans Rights
|
||
;; 🏳️⚧️ Are Human R
|
||
;; ights
|
||
(verify-output
|
||
"\x1b[1m\x1b[3mTrans \x1b[0m\x1b[3mRights 🏳️\u200d\b \n\x1b[3m🏳️⚧️ \x1b[0mAre \x1b[3mHuman \x1b[0mR\nights"
|
||
(define port
|
||
(make-wrapping-port (current-output-port) 14))
|
||
(display "\x1b[1m\x1b[3mTrans \x1b[0m\x1b[3mRights 🏳️⚧️ \x1b[0mAre \x1b[3mHuman \x1b[0mRights" port))
|
||
|
||
;; I wish i were
|
||
;; a, but then ag
|
||
;; ain, no
|
||
(verify-output
|
||
"I wish I were \na sculptor\b\b\b\b\b\b\b\b\b, but then ag\nain, no"
|
||
(define port
|
||
(make-wrapping-port (current-output-port) 14))
|
||
(display "I wish I were a sculptor\b\b\b\b\b\b\b\b\b, but then again, no" port))
|
||
|
||
(test-end "test-wrap")
|