Second unit test

This commit is contained in:
Vivianne 2024-02-29 11:13:10 -05:00
parent f4b4dde8e0
commit d509aa254d
1 changed files with 24 additions and 0 deletions

View File

@ -22,4 +22,28 @@
(test-equal "Current sequence should be #f" #f (cur-seq)))))
(test-equal
"Text should contain a bold sequence with only one reset sequence"
"\x1b[1mhello\x1b[0m你好"
(call-with-output-string
(λ (str-port)
(define-values (ansi-port cur-seq reset restore)
(make-ansi-port-tuple str-port))
;; no-op reset
(reset)
(display "\x1b[1mhello" ansi-port)
(test-equal "cur-seq should have bold"
"\x1b[1m"
(cur-seq))
;; op reset
(reset)
(display "你好" ansi-port))))
(test-end "test-ansi")