diff --git a/tests/test-wrap.scm b/tests/test-wrap.scm new file mode 100644 index 0000000..b996329 --- /dev/null +++ b/tests/test-wrap.scm @@ -0,0 +1,31 @@ +(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-values (port reset) + (make-wrapping-port-pair (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\b\n\x1b[1m;3m🏳️‍⚧️ \x1b[0mAre \x1b[3mHuman \x1b[0mR\nights" + (define-values (port reset) + (make-wrapping-port-pair (current-output-port) 14)) + (display "\x1b[1m\x1b[3mTrans \x1b[0m\x1b[3mRights 🏳️‍⚧️ \x1b[0mAre \x1b[3mHuman \x1b[0mRights" port)) + + +(test-end "test-wrap")