fix print in drracket in the case when the depth is passed

in and isn't 0

Thanks to Matthew for pointing out the fix
This commit is contained in:
Robby Findler 2013-11-11 22:38:09 -06:00
parent 3e2911d30f
commit ba334135bb
2 changed files with 17 additions and 5 deletions

View File

@ -68,6 +68,10 @@ the settings above should match r5rs
(prepare-for-test-expression) (prepare-for-test-expression)
(test-expression "(print 'hello (current-output-port) 1)" "hello")
(test-expression "(print 'hello (current-output-port) 0)" "'hello")
(test-expression "(print '((x)) (current-output-port) 0)" "'((x))")
(test-expression "(require racket/gui/base)(require racket/class)(make-object bitmap% 1 1)" (test-expression "(require racket/gui/base)(require racket/class)(make-object bitmap% 1 1)"
"{image}" "{image}"
"{image}") "{image}")
@ -1333,9 +1337,9 @@ the settings above should match r5rs
;; setup print / pretty-print difference ;; setup print / pretty-print difference
(clear-definitions drs) (clear-definitions drs)
(for-each fw:test:keystroke (insert-in-definitions
(string->list drs
"(define (f n)\n(cond ((zero? n) (list))\n(else (cons n (f (- n 1))))))\n(f 200)")) "(define (f n)\n(cond ((zero? n) (list))\n(else (cons n (f (- n 1))))))\n(f 200)")
(test "Constructor" #f #f (test "Constructor" #f #f
(case-lambda (case-lambda
[(x) (not (member #\newline (string->list x)))] [(x) (not (member #\newline (string->list x)))]
@ -1351,7 +1355,13 @@ the settings above should match r5rs
(test plain-print-style #f #t (test plain-print-style #f #t
(case-lambda (case-lambda
[(x) (member #\newline (string->list x))] [(x) (member #\newline (string->list x))]
[() "newlines in result (may need to make the window smaller)"])))) [() "newlines in result (may need to make the window smaller)"]))
(when has-print-printing?
(clear-definitions drs)
(insert-in-definitions drs "(print 'hello (current-output-port) 1)")
(test plain-print-style #f #t "hello")
(test plain-print-style #f #f "hello"))))
(define re:out-of-sync (define re:out-of-sync
(regexp (regexp

View File

@ -570,7 +570,9 @@
(my-setup-printing-parameters (my-setup-printing-parameters
(λ () (λ ()
(parameterize ([pretty-print-columns 'infinity]) (parameterize ([pretty-print-columns 'infinity])
((if write? pretty-write pretty-print) converted-value port))) (if write?
(pretty-write converted-value port)
(pretty-print converted-value port depth))))
setting setting
'infinity)))) 'infinity))))
(current-inspector (make-inspector)) (current-inspector (make-inspector))