mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +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:
parent
8ac25f3fae
commit
bf3c632b82
2 changed files with 6 additions and 2 deletions
|
@ -32,6 +32,6 @@
|
||||||
(lambda (box port)
|
(lambda (box port)
|
||||||
(display "#<box " port)
|
(display "#<box " port)
|
||||||
(display (number->string (object-address box) 16) port)
|
(display (number->string (object-address box) 16) port)
|
||||||
(display " value: ")
|
(display " value: " port)
|
||||||
(write (unbox box) port)
|
(write (unbox box) port)
|
||||||
(display ">" port)))
|
(display ">" port)))
|
||||||
|
|
|
@ -62,4 +62,8 @@
|
||||||
(not (equal? box1 box2))
|
(not (equal? box1 box2))
|
||||||
;; Guile extension, not guaranteed by SRFI-111.
|
;; Guile extension, not guaranteed by SRFI-111.
|
||||||
(begin (set-box! box2 (string #\f #\o #\o))
|
(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"))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue