1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Fix bug in srfi-111 box printer

* module/srfi/srfi-111.scm: Add missing port.
* test-suite/tests/srfi-111.test: Test.
This commit is contained in:
Daniel Llorens 2025-01-16 15:46:05 +01:00
parent 8ac25f3fae
commit bf3c632b82
2 changed files with 6 additions and 2 deletions

View file

@ -32,6 +32,6 @@
(lambda (box port)
(display "#<box " port)
(display (number->string (object-address box) 16) port)
(display " value: ")
(display " value: " port)
(write (unbox box) port)
(display ">" port)))

View file

@ -62,4 +62,8 @@
(not (equal? box1 box2))
;; Guile extension, not guaranteed by SRFI-111.
(begin (set-box! box2 (string #\f #\o #\o))
(equal? box1 box2)))))))
(equal? box1 box2))))))
(pass-if "box printer"
(integer? (string-contains (call-with-output-string (lambda (o) (display (box 1) o)))
"value: 1"))))