fix part of #53, assertion failure in print_traverse

This commit is contained in:
Jeff Bezanson 2019-06-06 19:34:00 -04:00 committed by Lassi Kortela
parent 0b6dd2ca11
commit 150a160960
2 changed files with 12 additions and 0 deletions

View File

@ -89,6 +89,9 @@ void print_traverse(value_t v)
for(i=0; i < vector_size(v); i++)
print_traverse(vector_elt(v,i));
}
else if (iscprim(v)) {
// don't consider shared references to e.g. chars
}
else if (isclosure(v)) {
mark_cons(v);
function_t *f = (function_t*)ptr(v);

View File

@ -292,5 +292,14 @@
(assert (equal? 1.0 (* 1.0 1))) ; tests that * no longer does inexact->exact
(define (with-output-to-string nada thunk)
(let ((b (buffer)))
(with-output-to b (thunk))
(io.tostring! b)))
(let ((c #\a))
(assert (equal? (with-output-to-string #f (lambda () (print (list c c))))
"(#\\a #\\a)")))
(princ "all tests pass\n")
#t