[Git][cmucl/cmucl][issue-139-set-terminal-to-utf8] Test external format if sys:*tty* is a two-way-stream

Raymond Toy (@rtoy) gitlab at common-lisp.net
Sun Dec 4 16:29:48 UTC 2022



Raymond Toy pushed to branch issue-139-set-terminal-to-utf8 at cmucl / cmucl


Commits:
a34aa173 by Raymond Toy at 2022-12-04T08:28:25-08:00
Test external format if sys:*tty* is a two-way-stream

`sys:*tty*` can be an `fd-stream` or `two-way-stream`.  Test that the
external format in both cases has the expected value.

- - - - -


1 changed file:

- tests/issues.lisp


Changes:

=====================================
tests/issues.lisp
=====================================
@@ -709,9 +709,14 @@
     (assert-eq locale-format (stream-external-format sys:*stdout*))
     (assert-eq locale-format (stream-external-format sys:*stderr*))
     ;; sys:*tty* can either be an fd-stream or a two-way-stream.
-    ;; stream-external-format doesn't work for a two-way-stream.
-    (unless (typep sys:*tty* 'two-way-stream)
-      (assert-eq locale-format (stream-external-format sys:*tty*)))))
+    (etypecase sys:*tty*
+      (system:fd-stream
+       (assert-eq locale-format (stream-external-format sys:*tty*)))
+      (two-way-stream
+       (assert-eq locale-format
+		  (stream-external-format (two-way-stream-input-stream sys:*tty*)))
+       (assert-eq locale-format
+		  (stream-external-format (two-way-stream-output-stream sys:*tty*)))))))
 
 (define-test issue.139-default-external-format-read-file
     (:tag :issues)



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a34aa173120c6efd4769670a874196951a4728d0

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a34aa173120c6efd4769670a874196951a4728d0
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20221204/7d88a1b4/attachment.html>


More information about the cmucl-cvs mailing list